Commit Graph

1296 Commits

Author SHA1 Message Date
waldemar%netscape.com
ae9043e328 Changed bottom expressions to syntax error throws 1999-10-20 20:58:07 +00:00
waldemar%netscape.com
1e24527b04 Added upper-case Greek letters 1999-10-20 20:57:37 +00:00
waldemar%netscape.com
30f65ba3aa Removed types from bottom expressions 1999-10-20 02:27:53 +00:00
waldemar%netscape.com
d092c9ad87 First Checked In. 1999-10-20 02:27:34 +00:00
waldemar%netscape.com
1178f50d75 Changed syntax of getters and setters to "get name" and "set name". Relaxed grammar constraints on definitions. Changed over to colon syntax for types. Added local visibility and block modifiers. 1999-10-20 00:46:31 +00:00
waldemar%netscape.com
aab1c75cc8 Removed octal escapes. Replaced bottom by throw of syntax error. 1999-10-20 00:43:58 +00:00
waldemar%netscape.com
cf8b608c8c Removed octals. Removed rational-to-integer, which was replaced by semantic subtyping. Replaced bottom by throw of syntax error. 1999-10-20 00:43:22 +00:00
waldemar%netscape.com
890dfc92af Removed rational-to-integer and types in bottom calls, which were replaced by semantic subtyping 1999-10-20 00:42:17 +00:00
waldemar%netscape.com
20e07c2f9d Removed rational-to-integer, which was replaced by semantic subtyping 1999-10-20 00:41:59 +00:00
waldemar%netscape.com
2588b24207 Added semantic subtyping, throw, and catch 1999-10-20 00:40:55 +00:00
waldemar%netscape.com
333e67f4e1 Fixed bug that would sometimes emit a newline between a backslash and its following escaped character 1999-10-20 00:40:04 +00:00
rogerl%netscape.com
ff8324352d r=norris
Delayed functionDef from creating property until after the body parses
succesfully.
1999-10-19 21:07:45 +00:00
rogerl%netscape.com
1beeb9a9fa r=norris
Fixed bug #12951 - var if for..in statement should always be of type
string.
1999-10-19 21:06:03 +00:00
norris%netscape.com
aec69cc2f4 Fixed bug. We weren't loading classes in bottom-up dependency order.
Subject:
            Re: another getClassLoader exception
       Date:
            Mon, 18 Oct 1999 22:01:24 -0400
      From:
            Andrew Wason <aw@softcom.com>
        To:
            norris@netscape.com (Norris Boyd)
        CC:
            Howard Lin <howard@softcom.com>
 References:
            1 , 2




At 05:03 PM 10/18/99 -0700, Norris Boyd wrote:
>Are you still seeing this problem?


Yes.  I just did a CVS update to get the latest stuff and we still have
this problem.

I wrote a standalone sample program that duplicates the problem.  Run
JSSupport and you should get this exception:

defineClass org.mozilla.javascript.gen.c2
Exception in thread "main" java.lang.NoClassDefFoundError:
org/mozilla/javascript/gen/c1
         at java.lang.ClassLoader.resolveClass0(Native Method)
         at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
         at
JSSupport$MySecuritySupport$DataClassLoader.loadClass(JSSupport.java:89)
         at JSSupport$MySecuritySupport.defineClass(JSSupport.java:47)
         at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
Compiled Code)
         at org.mozilla.javascript.Context.compile(Context.java:1761)
         at org.mozilla.javascript.Context.compile(Context.java:1691)
         at org.mozilla.javascript.Context.compileReader(Context.java:810)
         at org.mozilla.javascript.Context.evaluateReader(Context.java:725)
         at org.mozilla.javascript.Context.evaluateString(Context.java:692)
         at JSSupport.<init>(JSSupport.java:20)
         at JSSupport.main(JSSupport.java:9)



Andrew



>--N
>
>Andrew Wason wrote:
>
> > At 04:54 PM 10/12/99 -0700, Norris Boyd wrote:
> > >I just checked in changes so that the class calling ScriptRuntime (c5
> in your
> > >case) will load the class itself using the normal Java classloading
> mechanism
> > >rather than an explicit call to the class loader. I pushed the bits up
> to the
> > >ftp site, but it takes a bit to propagate.
> >
> > I get this exception now (debugging statements are from my code):
> >
> > SecuritySupport.defineClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c4
> > using default loader com.softcom.realjava.PluginClassLoader@da9486a0
> > java.lang.NoClassDefFoundError: org/mozilla/javascript/gen/c4
> >          at java.lang.ClassLoader.resolveClass0(Native Method)
> >          at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
> >          at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport$Da
> > taClassLoader.loadClass(RealJavaScript.java:410)
> >          at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport.de
> > fineClass(RealJavaScript.java:352)
> >          at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
> > Compiled Code)
> >          at org.mozilla.javascript.Context.compile(Context.java:1761)
> >          at org.mozilla.javascript.Context.compile(Context.java:1691)
> >          at org.mozilla.javascript.Context.compileReader(Context.java:810)
> >
> > So when c5 is being loaded by my SecuritySupport, it also needs to load c4.
> > I decompiled org.mozilla.javascript.gen.c5 and it's constant pool
> > references CLASS org.mozilla.javascript.gen.c4, so c5 is dependent on c4
> > being loadable.  Is the problem that c5 is being loaded before the
> > optimizer has defined c4?
> >
> > I get the above exception for some classes and not others.  It seems
> > consistent that I always get it for classes with dependencies on other
> > optimizer classes that haven't been generated yet.
> >
> > Andrew
> >
> > --
> > Andrew Wason
> > SoftCom, Inc.
> > aw@softcom.com

--
Andrew Wason
SoftCom, Inc.
aw@softcom.com



   JSSupport.java

                  Name:
                         JSSupport.java
                   Type:
                         Java Source File (text/java)
                Encoding:
                         base64
1999-10-19 16:38:23 +00:00
jband%netscape.com
021034bc23 trivial fix to get rid of warning from copy/paste error - was passing unused argument to printf 1999-10-19 08:00:29 +00:00
beard%netscape.com
abc5e4e01f changed NSLibraryStartup.o to NSComponentStartup.o, since it's really a component. r=jband 1999-10-19 06:31:49 +00:00
jband%netscape.com
c897592a24 fixing brendan's copy/paste bug that broke gc. r=shaver 1999-10-19 05:58:07 +00:00
cls%seawood.org
b82455a5f6 Use PR_TRUE instead of c++ keyword "true" in case of broken/out-of-date compilers.
r=syd
1999-10-19 05:38:27 +00:00
jband%netscape.com
63c50e078a checking in code to fix bug 12768 submitted by Dan.Oscarsson@trab.se. Needed a 'const char*' tmp varible to work with a 'const char*' buffer that was passed in. The same problem is in both js.c and xpcshell.cpp. r=jband 1999-10-18 23:45:39 +00:00
jband%netscape.com
d99faca17a checking in bug 16629 fix to cbegle's xpconnect tests submitted by green@FreeBSD.org. This fixes screwy longlong test methods. r=jband 1999-10-18 23:20:16 +00:00
rogerl%netscape.com
c617326211 Changed tests for ECMA 3 definition of array.length handling. 1999-10-18 16:55:44 +00:00
jband%netscape.com
ce4c41ef7d r=mccabe (I'll be adding more comments to the headers as requested)
Implement nsIXPCNativeCallContext to meet user feature
requirements. This allows simpler implementation of reflection of
native classes into JavaScript in cases where they need to
support legacy interfaces that include optional parameters and
method name overloading. This also provides a general mechanism
for native methods to discover if they were called from JS code,
exactly what JS parameters were passed, explicitly return jsvals,
and throw explicit jsvals without interference from xpconnect.
With test cases.
1999-10-18 02:53:04 +00:00
neeti%netscape.com
b6a3ba2192 Converted dll to use nsIModule -bug 14034, r=jband 1999-10-16 03:04:16 +00:00
fur%netscape.com
f4b621e214 Renamed variable to avoid a compiler warning. R: mccabe 1999-10-15 21:38:04 +00:00
mccabe%netscape.com
a1db28e781 Fix line editing support for the standalone XPCOM-enabled JavaScript shell. To aid debugging on unix platforms.
To use, define JS_READLINE when compiling mozilla/js/src/xpconnect/shell.

r=shaver
1999-10-15 21:23:53 +00:00
waterson%netscape.com
2fd7083138 Add xpcnativecallcontext.cpp for jband. 1999-10-15 07:08:15 +00:00
brendan%mozilla.org
8371c29ee7 1. Fixed missing JS_LOCK_GC in JS_YieldRequest, commented other badness there.
2.  Cleaned up ugly JS_GC_Flag typedef name and put XXXbe comment in there for
    next time: someone seems to have patched around a deadlock that has since
    bit chouck@geocast.com.
3.  Fixed gcDisabled by moving it from cx to rt and updating it atomically.
4.  Fixed ECMA violation where for (var i, j in o) ... was permitted; only one
    variable is allowed.
(Item 4 was a bug on rogerl's list, since closed?  r=shaver@mozilla.org.)
1999-10-15 05:46:42 +00:00
jband%netscape.com
d4d440258b adding new empty placeholder file to the build. Will also add it to Mac project via camelot and put real stuff in it after all is stable. r=jband :) 1999-10-15 05:09:08 +00:00
shaver%netscape.com
34010403ff fix obj_getCount to property destroy state and propagate error (r=jband) 1999-10-15 04:32:46 +00:00
brendan%mozilla.org
ff9dec8d40 Rename ToSource to uneval (r=shaver@mozilla.org,terry@geocast.com). 1999-10-15 04:07:59 +00:00
jband%netscape.com
959b9a190e r=shaver
- Fixed two similar cases where code was missing one level of
pointer dereference in terminating a copied string. Was trashing
data further up the stack.
- Use 'nsAllocator::Free' in two similar cases where 'delete' was
mistakenly used. Error pointed out by Purify.
1999-10-15 03:31:09 +00:00
shaver%netscape.com
c182ce4717 make xpcshell use jsrtsvc, and let jsrtsvc handle JS_Shutdown (r=jband) 1999-10-15 03:05:48 +00:00
mgleeson1%netscape.com
ad3478d01d r=pepper HPUX specific change - enable 64-bit int for js 1999-10-14 23:20:27 +00:00
jband%netscape.com
27ff1e76cb Fixing leaks found by beard...
- Fixed leaked nsID ptr. bug 16373. This alsothrows a JS
exception when JS callers call createInstance or getService
using an (optional) param that is not an iid. This had been a
'XXX' in the code.
- Moved a release call out of just the error condition block in
setting up a ServiceReleaser. I should have caught this one, but
few of my tests use services :(  I have hopes that the whole
ServiceReleaser will become unnecessary as the ServiceManager
system changes and simply calling NS_RELEASE on a service becomes
sufficient.
- Cleaned up an addref/release pair in a setter (need to move to
nsComPtrs!) r=beard
1999-10-14 23:08:59 +00:00
cbegle%netscape.com
ff236233af * removed stuff from the idl file that caused warnings
* fixed a typo that caused a warning (nsIsupports)
* fixed values of constants that caused warnings
* use a macro instead of assinging a long long value directly

r=jband
1999-10-13 00:11:21 +00:00
norris%netscape.com
3700676b23 Fix following problem:
Subject:
        another getClassLoader exception
   Date:
        Tue, 12 Oct 1999 10:39:26 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com (Norris Boyd)
    CC:
        Howard Lin <howard@softcom.com>




Norris,

It looks like the classes the optimizer generates call
ScriptRuntime.defineFunction which calls getClassLoader.  This throws a
SecurityException.

java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader )
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
, Compiled Code)
at java.security.AccessController.checkPermission(AccessController.java,
Compiled Code)
at java.lang.SecurityManager.checkPermission(SecurityManager.java, Compiled
Code)
at java.lang.Class.getClassLoader(Class.java, Compiled Code)
at
org.mozilla.javascript.ScriptRuntime.defineFunction(ScriptRuntime.java:2045)
at org.mozilla.javascript.gen.c5.initScript(order.js)
at org.mozilla.javascript.gen.c5.exec(order.js)
at org.mozilla.javascript.Context.evaluateReader(Context.java:728)
[...]



Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-10-12 23:54:03 +00:00
norris%netscape.com
8a23341b00 Fix unix build warning.
Reviewed by rogerl@netscape.com.
1999-10-12 22:48:17 +00:00
norris%netscape.com
809bf6aa85 Remove redundant import. 1999-10-12 21:46:50 +00:00
norris%netscape.com
bc2eb782ee Fix release date, add contributor. 1999-10-12 16:52:13 +00:00
cbegle%netscape.com
f456d33c1b new files.
new tests for xpconnect.  r=jband.
1999-10-12 00:12:43 +00:00
rogerl%netscape.com
0ac353dd25 NOT A PART OF SEAMONKEY BUILD
- fixed test ECMA references,
- added test to -002
1999-10-11 22:59:25 +00:00
norris%netscape.com
11fd4bbe0e Fix bug:
Subject:
        optimizer SecurityException
   Date:
        Mon, 11 Oct 1999 17:37:51 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com (Norris Boyd)
    CC:
        Howard Lin <howard@softcom.com>




We use our own SecuritySupport implementation in Rhino.  This is properly
getting called by the optimizer to generate new classes (e.g.
org.mozilla.javascript.gen.c5 etc.)

However, after defining the class, Codegen.compile calls getClassLoader()
on the new class.  The default SecurityManager doesn't allow
getClassLoader() to be called and so an exception is thrown:

java.lang.RuntimeException: Malformed optimizer package
java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader )
        at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:138)
        at org.mozilla.javascript.Context.compile(Context.java:1761)
        at org.mozilla.javascript.Context.compile(Context.java:1691)
        at org.mozilla.javascript.Context.compileReader(Context.java:810)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:725)
        [...]

This is kind of a pain to duplicate outside of our application, but if you
require a test case I can create one.

Codegen is attempting to call loadClass() after it uses
SecuritySupport.defineClass().  Our SecuritySupport calls loadClass()
internally in its defineClass() implementation.  This is what JavaAdapter
expects.

This is from Codegen.compile():

                         if (securitySupport == null) {
                             if (Context.isSecurityDomainRequired())
                                 throw new SecurityException("Required " +
                                             "security context missing");
                             if (classLoader == null)
                                 classLoader = new JavaScriptClassLoader();
                             clazz = classLoader.defineClass(name, classFile);
                         } else {
                             clazz = securitySupport.defineClass(name,
classFile,
                                                                 securityDom
securityDomain);
                         }
                         ClassLoader loader = clazz.getClassLoader();
                         clazz = loader.loadClass(name);


This is from JavaAdapter.createAdapterClass():


         SecuritySupport ss = cx.getSecuritySupport();
         if (ss != null)  {
             Object securityDomain = cx.getSecurityDomainForStackDepth(-1);
             return ss.defineClass(adapterName, bytes, securityDomain);
         } else {
             if (classLoader == null)
                 classLoader = new MyClassLoader();
             classLoader.defineClass(adapterName, bytes);
             return classLoader.loadClass(adapterName, true);
         }


So JavaAdapter is assuming SecuritySupport.defineClass() will call
ClassLoader.loadClass() on the new class, while Codegen is assuming it
needs to call ClassLoader.loadClass() on the class defined by
SecuritySupport.defineClass().

These should be made consistent, and in both cases it should be assumed
that SecuritySupport will both define and load the class.


Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-10-11 22:48:13 +00:00
rogerl%netscape.com
ecb681ee1d NOT A PART OF SEAMONKEY BUILD
- removed redundant test & fixed test for 'super' to detect syntax error
1999-10-11 22:38:40 +00:00
jband%netscape.com
b93e33a858 Much of this is under the auspices of bug 15794. r=mccabe.
- map xpcshell's 'quit()' to a loop exit rather than calling
'exit(0)' so that the cleanup and leak detection code will still
get called.

- add NS_InitXPCOM and NS_ShutdownXPCOM to xpcshell to run said
cleanup and leak detection code.

- use more NS_IF_* macros

- fix numerous places where code assumed that
nsXPConnect::GetXPConnect() does not add a new ref on the
xpconnect singleton object (the behavior changed some time back
but not all the uses did - brainfade!).

- fix nsXPCException::NewException to automatically trim
'dataless' native stackframes off of the front of a stack trace.
The old system of manually telling it how many frames to trim was
not working well. We really want the first frame showing to be an
'interesting' frame so that callers who get exceptions thrown at
them will see some useful information rather than an empty native
frame that represents (but says nothing about) some native frame
in the xpconnect runtime.

- remove an extra addref from the trimming loop in
nsXPCException::NewException.

- Stop building XPCJSStack objects. XPConnect stacks are singly
linked lists of XPCJSStackFrame objects with refcounted links. I
had this stupid idea that each object would have a refcounted
link to a XPCJSStack object that would tie together the lifetimes
of all objects in the chain. This was overcomplex and
unnecessary. The linked list was enough. Any frame without a
refcount deserved to be deleted because it is simply unreachable.
There was no reason to tie together all the lifetimes of each
object in the chain. So this has been simplified in a big way.

- fixed place in xpcthrower.cpp where we were leaking a refcount
on the xpconnect singleton each time an xpcexception was thrown.

- do cleanup and gc() at the end of xpctest_echo.js to use for
leak testing - all wrappers should go away.
1999-10-09 06:01:57 +00:00
rogerl%netscape.com
a5bd278835 Fixed 14060 - calling exec on java methods was gettmg caught by exec
trapping nonsense.
1999-10-08 22:55:33 +00:00
cbegle%netscape.com
cafc7b6951 Adding new files. Tests for XPConnect. These files are not part of the
build.  R=jband@netscape.com
1999-10-08 20:45:37 +00:00
kipp%netscape.com
65f6ba5343 Cleanup moz-decl-counter usage and fix NS_LOG_ADDREF usage 1999-10-08 20:41:19 +00:00
warren%netscape.com
8c71c45537 Fixed AddRef/Release problems to eliminate negative refcounts in Bloaty. 1999-10-08 01:49:06 +00:00
jband%netscape.com
68de88b11a fix warning of old style C++ variable scope declared in 'for'. bug 15778. r=slamm 1999-10-08 00:11:05 +00:00
rogerl%netscape.com
59df6ba2b7 Fixed build failures - these files are NOT part of the seamonkey build. 1999-10-07 20:45:27 +00:00