Commit Graph

4168 Commits

Author SHA1 Message Date
nboyd%atg.com
b0dabdc3df Turn on debug info in class files by default. 2002-03-13 19:34:23 +00:00
nboyd%atg.com
e584b07f01 Fix problem reported in newsgroup:
If I have a Java class with a normal method that throws an exception, Rhino
(1.5pre4) will let JavaScript catch the exception. If the Java class has a
getter method, Rhino will NOT let JavaScript catch the exception. Very
disturbing.

Here's a console dump to show you what I'm talking about:

D:\jsSandbox>cat GIJoe.java
public class GIJoe
{
        // Getter
        public static int getYoJoe()
                throws Exception
        {
                throw new Exception("Please catch me!");
        }

        // Normal
        public static int rebel()
                throws Exception
        {
                throw new Exception("Please catch me too!");
        }
}
D:\jsSandbox>javac GIJoe.java

D:\jsSandbox>cat gi.js
var gi = new Packages.GIJoe();

try
{
        var i = gi.rebel();
        java.lang.System.err.println("rebel(): uncaught");
}
catch(e1)
{
        java.lang.System.err.println("rebel(): caught");
}


try
{
        var i = gi.yoJoe;
        java.lang.System.err.println("yoJoe: uncaught");
}
catch(e2)
{
        java.lang.System.err.println("yoJoe: caught");
}


D:\jsSandbox>java -cp .;e:\javas\rhino1_5R4pre\js.jar
org.mozilla.javascript.too
ls.shell.Main
js> load("gi.js");
rebel(): caught
java.lang.Exception: Please catch me!
org.mozilla.javascript.WrappedException: WrappedException of Please catch
me!
        at org.mozilla.javascript.JavaMembers.get(JavaMembers.java:105)
        at
org.mozilla.javascript.NativeJavaObject.get(NativeJavaObject.java:93)

        at
org.mozilla.javascript.ScriptRuntime.getProp(ScriptRuntime.java:691)
        at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1591)
        at
org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:
63)
        at
org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:
54)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:741)
        at
org.mozilla.javascript.tools.shell.Main.evaluateReader(Main.java:347)

        at
org.mozilla.javascript.tools.shell.Main.processSource(Main.java:336)
        at org.mozilla.javascript.tools.shell.Global.load(Global.java:169)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.mozilla.javascript.FunctionObject.callVarargs(FunctionObject.java
:586)
        at
org.mozilla.javascript.FunctionObject.call(FunctionObject.java:460)
        at
org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1216)
        at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1679)
        at
org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:
63)
        at
org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:
54)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:741)
        at
org.mozilla.javascript.tools.shell.Main.evaluateReader(Main.java:347)

        at
org.mozilla.javascript.tools.shell.Main.processSource(Main.java:284)
        at org.mozilla.javascript.tools.shell.Main.exec(Main.java:146)
        at org.mozilla.javascript.tools.shell.Main.main(Main.java:74)
js>



Due to a lack of an "uncaught" statement in the output, we see that the
exception from GIJoe::getYoJoe() was indeed thrown, but not caught by the
JavaScript.

Do any nightly builds past 1.5pre4 address this issue?


Todd Trimmer
2002-03-13 13:33:40 +00:00
brendan%mozilla.org
05d2d349ce khanson@netscape.com's patch to switch from QuickSort to heap-sort, plus a crucial ECMA-purity/property-tree-perf fix to InitArrayObject (to SET rather than DEFINE; bug 99120, r=waldemar, sr=shaver&brendan, a=asa). 2002-03-13 01:50:13 +00:00
igor%mir2.org
f5b8fd5697 Rename catchStack to tryStack and allocate it only when required 2002-03-12 22:02:55 +00:00
igor%mir2.org
5e73d7338f Move definitions of interpreter bytecode specific tokens like BREAKPOINT or INTNUMBER to Interpreter.java.
Use switch instead of string array to return token names not to depend on token oder.
2002-03-12 22:00:56 +00:00
brendan%mozilla.org
21978efea8 Missing JSFunction API (129545, r=shaver, sr=jband, a=asa). 2002-03-12 21:58:27 +00:00
brendan%mozilla.org
5074f6ebd1 Don't forget to lock obj in js_AddNativeProperty and js_ChangeNativePropertyAttrs (130137, r=jband, sr=shaver, a=roc+moz). 2002-03-12 07:17:30 +00:00
gerv%gerv.net
f66a83002c Replacing original licensing text from C version of this file. 2002-03-11 23:11:55 +00:00
jband%netscape.com
cb6ae8ad3e fix bug 129697. Don't leave a dangling (to crash later) JS root if JS_NewObject fails while creating a wrapped native. r=beard sr=jst a=asa (for trunk and 0.9.9 branch). 2002-03-09 03:01:44 +00:00
brendan%mozilla.org
75a8745d3d Avoid MSVC bogo-warning. 2002-03-09 00:55:26 +00:00
brendan%mozilla.org
efe08cd95c Fix longstanding bug where watchpoints didn't work with JSPROP_SETTER (127243, r=rginda, sr=shaver, a=dbaron). 2002-03-08 22:46:13 +00:00
beard%netscape.com
cb2b8b58fb Fix for bug #123920, prevents reentering the JS engine during Java object JS wrapper finalization, by deferring calls into Java at the end of the garbage collection cycle and storing the wrappers in a linked list, which gets processed by a GC callback.
r=jband, sr=brendan, a=asa
2002-03-08 22:37:40 +00:00
seawood%netscape.com
d97d6d301f This patch replaces the bogus USE_AUTOCONF ifdef + platform ifdef tests with a
simple HAVE_LOCALTIME_R test.  -DHAVE_LOCALTIME_R has been added to the
js/src/config/<platform>.mks as necessary.
bug #128556 r=brendan sr=shaver a=asa
2002-03-08 01:42:32 +00:00
rginda%netscape.com
36a0ec70a8 bug 128057, r=brendan, sr=shaver, a=asa
check for JS_GetPropertyDesc failure in JS_GetPropertyDescArray
2002-03-06 22:12:38 +00:00
darin%netscape.com
f1a6738b6c fixes bug 124042 "support internationalized URIs" r=dougt, sr=alecf, a=asa 2002-03-06 07:48:55 +00:00
pschwartau%netscape.com
aa69c199eb Skip new test that uses the clone() function in SpiderMonkey's js.c file 2002-03-06 05:34:22 +00:00
pschwartau%netscape.com
9ee868f523 Initial add. Regression test for bug 127557. 2002-03-06 05:14:58 +00:00
brendan%mozilla.org
4047cc7888 Not part of build, for the js testsuite only: add clone shell function to clone a function object (for 127557 regression testing, a=shaver). 2002-03-06 04:45:32 +00:00
beard%netscape.com
e56ba03add Universal config file for Darwin. 2002-03-05 15:52:37 +00:00
beard%netscape.com
3dbc5b854c fix for bug #59686, a=asa@mozilla.org, r=rogerl, sr=shaver. 2002-03-05 15:09:05 +00:00
shaver%mozilla.org
dac4fdf779 Bug 106864: xptcall support for the ARM platform, and mild jsnum.h arm-define
tweaks. Patches from Mark Crichton <crichton@gimp.org>, Russell King
<rmk@arm.linux.org>, Jeroen Dobbelaere <jeroen.dobbelaere@acunia.com>.
r=brendan on jsnum.h, sr=shaver, a=asa for trunk and branch.
2002-03-05 06:35:50 +00:00
nisheeth%netscape.com
8872795d15 Fix for bug 125465. r=jag, sr=jband, a=asa. Add AString, ACString, and AUTF8String support to XPCOM's variant data type. Also, add forward declarations of AString and ACString to nsrootidl.idl. 2002-03-05 02:22:02 +00:00
beard%netscape.com
50d5d72d66 Needed for Mac OS X 10.1.3 / Darwin 5.3 2002-03-04 16:14:41 +00:00
pschwartau%netscape.com
62884a5780 Initial add. Regression test for bug 122076. 2002-03-04 04:11:47 +00:00
nboyd%atg.com
b0a4347b88 Enter context if need be; JavaAdapters may have callbacks on threads unassociated
with contexts.
2002-03-03 16:16:07 +00:00
brendan%mozilla.org
be783ec091 Runaway recursion safety for Exception and js_ErrorToException.
The latter no longer calls the former via js_ConstructObject, to
minimize failure opportunities when converting an error into an
exception.  Also, the 'stack' property of exception objects
faithfully preserves Unicode in function names and decompiled
actual argument sources.

Also, fun_xdrObject was reversing property order when encoding;
fixed to maximize property tree compression gain.

Also^2, js_ConstructObject was not handling success+not-found
return from FindConstructor.

bug 127136, r=rginda, sr=shaver, a=chofmann
2002-03-03 00:59:16 +00:00
brendan%mozilla.org
4f6d566527 Fix topcrash regression from bug 62164: keep track of duplicate kids below the root ply of the property tree, so we can fix up each dup's parent link (128258, r=shaver, sr=jband, a=asa). 2002-03-01 23:29:54 +00:00
brendan%mozilla.org
32d76a128b Fix call_enumerate to reflect compiler-created properties from function to its call object (127557, r=jband, sr=shaver, a=asa). 2002-03-01 23:25:34 +00:00
pschwartau%netscape.com
ccbe9ac802 Skip new test that uses the Error.stack property of SpiderMonkey. 2002-03-01 21:58:23 +00:00
pschwartau%netscape.com
ad883cb710 Initial add. Testing the Error.stack property of SpiderMonkey. This is an ECMA extension. 2002-03-01 21:50:18 +00:00
brendan%mozilla.org
8ecde6229e Fix GC_MARK_DEBUG #ifdef'd code (not part of default build; r=polarbear, sr=shaver, a=dbaron). 2002-03-01 05:22:26 +00:00
pschwartau%netscape.com
10d321f38d Improved regexp reporting for Rhino by imitating SpiderMonkey's Array.toSource() method. 2002-02-27 18:36:46 +00:00
rginda%netscape.com
f120347fbe part of bug 109652, "Venkman needs to profile" r=peterv,r=a=shaver
add profiling support.
2002-02-27 09:24:14 +00:00
rginda%netscape.com
72469311ce part of bug 109652, "Venkman needs to profile"
sr=brendan, r=peterv, a=shaver
add JS_Now to the jsapi, and JS_GetScriptVersion to jsdbgapi
2002-02-27 09:17:21 +00:00
sfraser%netscape.com
2f1de24dbc Fixing Mac bustage; add a bunch of casts between PRUnichar* and jschar* (why isn't jschar a wchar_t?). r=nisheeth 2002-02-26 03:01:03 +00:00
nisheeth%netscape.com
46db685f9a Fix for bug 84186. r=dbradley, jag. sr=jband. Added support for CStrings, UTF8String, and AStrings to XPIDL. Also added the -t cmd line flag to XPIDL and XPTLINK that allows us to generate output for a specific XPT version. The XPT version number is being upped from 1.1 to 1.2 with this checkin. 2002-02-26 01:41:42 +00:00
igor%mir2.org
5c5912869d Use ClassFileWriter.toByteArray to get class file bytes in place of calling ClassFileWriter with ByteArrayStream argument 2002-02-24 19:18:44 +00:00
igor%mir2.org
d4c437f2c0 1. Added toByteArray to get class file as a byte array. Implementation first calculates the resulting array size to minimize number of allocations.
2. Set DEBUG to true to activate usage checks
2002-02-24 19:15:19 +00:00
brendan%mozilla.org
bcc02f397b Fix stale comment about duplicate formal params (a=drivers, comment-only followup to 62164's big patch). 2002-02-24 00:26:57 +00:00
brendan%mozilla.org
032c9bde1f Comment change only, quick followup to last humongous checkin. 2002-02-23 04:44:40 +00:00
brendan%mozilla.org
57483a3082 Major footprint/perf win: share property state using a tree whose root represents empty scopes, and whose non-root nodes represent scopes with properties added in order from the root to that node; to use double hashing to map these tree-paths for per-scope property lookup; and avoid locking where possible through immutability and mostly-benign&rare race tolerance (62164, r=shaver, sr=jband). 2002-02-23 03:49:27 +00:00
pschwartau%netscape.com
46e46a7d7e Adding two more cases to test. Improving readability. 2002-02-23 01:14:51 +00:00
nboyd%atg.com
a12ac7748a Missed one codepath in previous fix for 126722. This should complete the fix. 2002-02-22 17:40:32 +00:00
nboyd%atg.com
50423a21d4 Fix bug 126722 2002-02-21 15:53:50 +00:00
pschwartau%netscape.com
f124320735 Initial add. 2002-02-20 19:07:08 +00:00
jband%netscape.com
78dddf0f3b fix bug 126333. reduce shutdown leakage by releaseing Components object members. r=dbradley sr=alecf 2002-02-20 07:03:27 +00:00
rginda%netscape.com
24f2a77101 bug 126365, "add options and private support to jsdIContext", sr=jst, r=jband
add jsdIContext::options and ::privateData attributes
2002-02-20 05:45:57 +00:00
rogerl%netscape.com
e2486ebfbe r=thesteve, sr=brendan, bug @119909 - crashing RegExp with > 10 backrefs. 2002-02-20 05:43:26 +00:00
dbradley%netscape.com
5372835bdb Bug 119382 - attribute nsIIDPtr IID considered harmful - This patch makes it an error to declare an attribute named IID or a method named getIID. r=jband, sr=jst 2002-02-19 14:48:00 +00:00
dbradley%netscape.com
db81563416 Bug 121938 - XPCWrappedJS::GetNewORUsed does not look for inherited interfaces when matching interfaces. r=jband, sr=jst 2002-02-19 11:24:21 +00:00