Commit Graph

3118 Commits

Author SHA1 Message Date
nboyd%atg.com
b02120e058 Add top-level boolean parameter so ClassOutput implementors can determine
which class to load to execute a script.
2001-02-26 15:28:17 +00:00
pschwartau%netscape.com
d3de39854b Added Stephen Ostermiller's pattern-match from bug 69989 to this test - 2001-02-24 03:23:27 +00:00
brendan%mozilla.org
55d5713602 Don't deprecate __proto__, there ain't no forward-compatible alternative (68401, r=timeless, sr=shaver). 2001-02-24 03:07:58 +00:00
brendan%mozilla.org
ee954accd5 - Shaver hacked this fix with advice from me, and I carried it to check-in. We now avoid a heavyweight outer function when the inner one is defined at top-level or in an expression (is not a JSOP_CLOSURE, IOW), and it doesn't refer to any non-local names. See bug 65308 for details on the win. (r=rogerl, sr=brendan)
- Fix scope chain for nested functions at top-level (JSOP_DEFFUN), in a part of another statement (JSOP_CLOSURE), and unnamed in an expression (JSOP_ANONFUNOBJ) to match ECMA-262 13.2.  My bad: fp->varobj was used up till now, instead of fp->scopeChain; we still *bind* the name of a statement-level (top or not) nested function in fp->varobj.  This fixes bug 69559.  (r=rogerl, sr=jband)
- Add an Intern command to the shell, for GC vs. intern'ed atom testing.
2001-02-24 03:00:56 +00:00
pschwartau%netscape.com
484642e6df Initial add. Regression test for bug 69607. 2001-02-23 07:35:47 +00:00
nboyd%atg.com
446ea9e8da Real fix for last problem. 2001-02-22 14:45:10 +00:00
disttsc%bart.nl
a6f2f5861a Mass REQUIRES update to synch up with string lib and xul changes in an attempt to fix senna bustage. r=jst, sr=cls 2001-02-22 09:35:51 +00:00
brendan%mozilla.org
147be84ecc Fix duplicate parsenode recycle in constant-folded if/else or ?: (69607, r=shaver, sr=jband). 2001-02-22 07:30:57 +00:00
brendan%mozilla.org
3d3ee5cbd3 Remove unused code (sr=jband, r=mozbot). 2001-02-21 10:49:35 +00:00
nboyd%atg.com
25a2852250 Subject:
Rhino Context.setTargetClassFileName() null pointer exception
        Date:
             Tue, 20 Feb 2001 15:28:20 -0800
       From:
             "Ryan Manwiller" <rdm@europa.com>
 Organization:
             Another Netscape Collabra Server User
 Newsgroups:
             netscape.public.mozilla.jseng




I'm setting the file name to compile to a file. However, on subsequent
compiles, I don't want to compile to a file, so I tried
setTargetClassFileName(null). This causes a NullPpinterException in
OptClassNameHelper.setTargetClassFileName(OptClassNameHelper.java:76)

It seems that Context.setTargetClassFileName() should check for null.

Thanks
2001-02-21 02:08:05 +00:00
pschwartau%netscape.com
f9086bf830 Minor whitespace deletion - 2001-02-21 00:58:41 +00:00
pschwartau%netscape.com
5331662996 Minor change to comment - 2001-02-21 00:39:46 +00:00
pschwartau%netscape.com
538ea61c08 Improving error message - 2001-02-21 00:27:13 +00:00
jband%netscape.com
a96a22f464 Avoid use of dead JSContext in dtor. bug 69463. Thanks to Waleri Todorov <waleri@gti.bg> for pointing out this bug. r=shaver sr=brendan 2001-02-21 00:01:30 +00:00
pschwartau%netscape.com
f070a37023 Revising error in test. See bug 69441, where this was pointed out - 2001-02-20 22:11:44 +00:00
jband%netscape.com
d242dcca69 bug 66610 - add xpconnect support for DOMStrings. r=jst sr=brendan 2001-02-20 08:09:19 +00:00
brendan%mozilla.org
bcb7e8d5fd Don't flush cached properties one-by-one if GC'ing, because the GC flushes the whole thing (68735, r=jst, sr=jband). 2001-02-20 05:01:14 +00:00
brendan%mozilla.org
5f946f1796 Fix constant folder to recycle moved node, not whole tree, when simplifying 'true ? foo() : bar()' into 'foo()' (69345, r=shaver, sr=jband). 2001-02-20 01:25:39 +00:00
brendan%mozilla.org
da9be4b8bb Fix related eval and setTimeout regressions caused by bug 68498's patch (69165&69175, r=jband, sr=shaver). 2001-02-19 00:31:20 +00:00
shaver%mozilla.org
9d74dff12a Fold constants correctly when emitting as we compile (TCF_COMPILING).
(#69304, r=jband, sr=brendan)
2001-02-18 20:58:08 +00:00
pschwartau%netscape.com
ed3d3552d7 Regression test for bug 68498. Derived from Brendan's attachment to the bug - 2001-02-18 03:31:17 +00:00
jband%netscape.com
51e076e20b rest of the fix for bug 68971 - can't share a kungfoodeathgrip. sr=brendan r=shaver 2001-02-16 02:21:22 +00:00
brendan%mozilla.org
b8a3d1e3ef Don't crash on a newborn object (68971, r=jband, sr=shaver). 2001-02-16 02:09:42 +00:00
brendan%mozilla.org
e0c2c3974f The rest of the fix for bug 68498, see the extensive comments in that bug (r=jband, sr=shaver). 2001-02-16 02:04:12 +00:00
brendan%mozilla.org
fd8a6ea21b Restore the much-loved, albeit non-ECMA, function caller property (65683, r=rogerl, sr=jband). 2001-02-14 22:33:26 +00:00
brendan%mozilla.org
cefe9bfa0d Don't assert about leaked atoms, do DEBUG fprints instead (68765, r=timeless, sr=jband). 2001-02-14 22:25:30 +00:00
brendan%mozilla.org
8aa6c94c12 Crash fix (first part, two more files to come) for old-style obj.eval in a function (68498, r=bryner, sr=jband). 2001-02-14 09:11:09 +00:00
dprice%netscape.com
997fb091c7 65845 first cut of the order files 2001-02-13 02:48:02 +00:00
brendan%mozilla.org
5fcc8a1adc - Keep interned string atoms around across zero-context episodes on a runtime,
until JS_DestroyRuntime is called (68450, r=rginda, sr=jband).
- NUL-terminate tagbuf in tagify, for the HTML helpers such as string.big()
  (66648, r=timeless, sr=jband).
2001-02-13 00:57:10 +00:00
beard%netscape.com
7f321c0039 fix for bug #63466, r=mstoltz, sr=brendan, a=leaf 2001-02-12 07:47:28 +00:00
nboyd%atg.com
82bd85bfce Fix for problem:
Subject:
             Rhino Exception Handling: Inconsistency btw Old/New Versions of 1.5
        Date:
             Mon, 05 Feb 2001 06:07:07 -0800
       From:
             Timothy Bergeron <bergeron@resumerabbit.com>
 Organization:
             Another Netscape Collabra Server User
 Newsgroups:
             netscape.public.mozilla.jseng




I've been using Rhino for about a year with almost no problems. However,
I downloaded the latest Rhino tip (rhino15R2pre) and discovered a
significant difference in exception handling.

I rely heavily on JavaScript code like the following:

try {
   var em  = new ExceptionMaker();
   em.npe();  // method throws a java.lang.NullPointerException
   //em.ae();  // method throws a Packages.AutomationException
}
catch (e if (e instanceof java.lang.NullPointerException)) {
   java.lang.System.out.println("Caught a NullPointerException");
   e.printStackTrace();
}
catch (e if (e instanceof Packages.AutomationException)) {
   java.lang.System.out.println("Caught an AutomationException");
}
catch (e) {
   java.lang.System.out.println("Caught an unexpected exception: "+e);
}
finally {
   java.lang.System.out.println("Finally!");
}

Previous Rhino versions worked as expected. The exception thrown from
within the host object would be caught and the appropriate actions could
be taken.

With the most recent tip, the thrown exceptions simply are not caught
within the JavaScript. They propagate back to the Java function invoking
the (in my case) Context.evaluateReader() method.

Running the above JS fragement with the older tip displayed the
following stack trace (when the NullPointerException was caught):

Rhino Version: JavaScript-Java 1.5 release 1 2000 03 15
Caught a NullPointerException
java.lang.NullPointerException
        at java.lang.Throwable.<init>(Throwable.java:84)
        at java.lang.Exception.<init>(Exception.java:35)
        at java.lang.RuntimeException.<init>(RuntimeException.java:39)
        at
java.lang.NullPointerException.<init>(NullPointerException.java:45)
        at ExceptionMaker.jsFunction_npe(ExceptionMaker.java:13)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.mozilla.javascript.FunctionObject.call(FunctionObject.java:497)
        at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1205)
        at org.mozilla.javascript.gen.c1.call(exception.js:3)
        at org.mozilla.javascript.gen.c1.exec(exception.js)
        at
org.mozilla.javascript.Context.evaluateReader(Context.java:739)
        at js.main(js.java:14)
Finally!

When run with the latest tip, the output is:

Rhino Version: JavaScript-Java 1.5 release 1 2000 03
15                                          Finally!
Exception in thread "main" java.lang.NullPointerException
        at java.lang.Throwable.<init>(Throwable.java:84)
        at java.lang.Exception.<init>(Exception.java:35)
        at java.lang.RuntimeException.<init>(RuntimeException.java:39)
        at
java.lang.NullPointerException.<init>(NullPointerException.java:45)
        at ExceptionMaker.jsFunction_npe(ExceptionMaker.java:13)
        at inv2.invoke()
        at
org.mozilla.javascript.FunctionObject.doInvoke(FunctionObject.java:843)
        at
org.mozilla.javascript.FunctionObject.call(FunctionObject.java:486)
        at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1199)
        at org.mozilla.javascript.gen.c1.call(Unknown Source)
        at org.mozilla.javascript.gen.c1.exec(Unknown Source)
        at
org.mozilla.javascript.Context.evaluateReader(Context.java:778)
        at js.main(js.java:14)

Curiously, both Rhino versions seem to be returning the same string from
Context.getImplementionVerison();

Anyway, the results from the two runs are clearly different: In the
first case, the exception is thown, the correct catch block is invoked
(hence the stace trace), and the finally block is invoked. In the second
case, the exception is thrown, the finally block is invoked, and the
exception is handled by the calling Java method rather than being
handled by the JavaScript code.

After some research, it appears this change was introducted by a
modification to FunctionObject.call()  (See
http://bugzilla.mozilla.org/show_bug.cgi?id=64788) which used to have:

       try {
            Object result = (method != null)
                            ? method.invoke(thisObj, invokeArgs)
                            : ctor.newInstance(invokeArgs);
            return hasVoidReturn ? Undefined.instance : result;
        }

but now has:

            Object result = method == null ?
ctor.newInstance(invokeArgs)
                                           : doInvoke(thisObj,
invokeArgs);

If I comment out the new code and replace it with the old, the expected
exception handling returns. Is this just an oversight or the new
expected behavior? Are there any negative side effects (other then the
speed decrease in method invocation) if I use the latest tip but use the
old method invocation procedure in FunctionObject.call() rather than the
new?
2001-02-08 18:56:58 +00:00
pschwartau%netscape.com
106efc7817 Exported functionality common to RegExp tests to new file js/tests/ecma_3/RegExp/shell.js 2001-02-08 04:04:48 +00:00
pschwartau%netscape.com
5cc9cfb919 Exported functionality common to RegExp testing to new file js/tests/ecma_3/RegExp/shell.js 2001-02-08 04:03:02 +00:00
pschwartau%netscape.com
766e838c4f Initial add. Contains functionality common to RegExp testing 2001-02-08 03:58:58 +00:00
pschwartau%netscape.com
f65b30a051 Whitespace cleanup 2001-02-08 01:32:58 +00:00
pschwartau%netscape.com
ad6952fe99 *** empty log message *** 2001-02-08 01:30:15 +00:00
pschwartau%netscape.com
a4c1795cc3 More minor adjustments - 2001-02-08 01:18:55 +00:00
pschwartau%netscape.com
e3608c31cf Minor adjustments - 2001-02-08 01:05:23 +00:00
pschwartau%netscape.com
39d6604a1c Initial add. Regression test for bug 67773 2001-02-07 23:19:12 +00:00
waldemar%netscape.com
8f98bed0e7 Added more semantics 2001-02-07 05:08:44 +00:00
waldemar%netscape.com
d341117db6 Added read-eval-print loop 2001-02-07 05:08:09 +00:00
waldemar%netscape.com
ae3e51a0c2 Updated to correspond to js2 site 2001-02-07 05:07:37 +00:00
waldemar%netscape.com
d0363e3b99 Added :semantic-comment and :vector-construct. 2001-02-07 05:07:05 +00:00
waldemar%netscape.com
42217499f5 Added vector comprehensions. Changed compiler to emit globals of functional type into the lisp function rather than value slots of symbols; this simplifies debugging. 2001-02-07 05:06:22 +00:00
waldemar%netscape.com
ffce7baf94 Added vector comprehensions and extra mode parameter for %section, %subsection, and %text. 2001-02-07 05:05:39 +00:00
brendan%mozilla.org
e23a1be36f Fix for bug 44009 (r=rogerl, sr=shaver)
- Remove bogus JS_ASSERT(!outermost) from the code that deals with a "#n="
  type string being returned from js_EnterSharpObject, where the hash entry
  is not yet sharp (because we haven't seen the object twice during depth
  first search).  This case trivially arises for the outermost object in,
  e.g., 'o={}; o.foo=o; uneval(o)'.
- Avoid parenthesizing #n={...} object initializers for uneval, as they are
  not ambiguous (whereas {foo:1}, e.g., is ambiguous because it could be a
  block statement containing a labeled expression statement, or it could be
  an object initializer).
- Death to tabs!
2001-02-06 23:19:44 +00:00
pschwartau%netscape.com
4cd5b867fb Made this testcase acknowledge that indirect eval is LEGAL; see bug 38512. 2001-02-06 07:57:17 +00:00
pschwartau%netscape.com
8e1d1ab4d9 Made this testcase acknowledge that indirect eval is LEGAL; see bug 38512. 2001-02-06 07:33:28 +00:00
pschwartau%netscape.com
8ab3095a6c Made this testase acknowledge that indirect eval is LEGAL; see bug 38512. 2001-02-06 06:52:59 +00:00
pschwartau%netscape.com
8097b07638 Deleting this testcase. It expected indirect eval to throw an exception. Wrong - this is legal: see bug 38512. 2001-02-06 06:06:18 +00:00