Граф коммитов

5170 Коммитов

Автор SHA1 Сообщение Дата
igor%mir2.org 6f97ac4088 Throw IllegalArgumentException from compileString/compileReader if script line number is negative instead of catching it much later via Context.codeBug(). 2003-07-09 19:27:46 +00:00
igor%mir2.org 5188320068 1. To evaluate script represented by String, use Context.evaluateString to avoid the need to create StringReader instances.
2. Catch VirtualMachineError so on out-of-memory/stack-overflow the shell will exit with System.exit(EXITCODE_RUNTIME_ERROR), not with 1. It will allow to distinguish cases when script tried to consume all available stack/memory with bugs in Rhino itself leading to NullPointerException etc.

3. Remove code to rethrow ThreadDeath from JavaScriptExcception since ThreadDeath is re-thrown by the engine itself.
2003-07-06 19:21:42 +00:00
igor%mir2.org dd893acd8d Caching of Method/Constructor.getParameterType()
To avoid constant calling of Method/Constructor.getParameterType() which creates a new Class array on each call, NativeJavaMethod stores the parameter types for its methods in methodTypes array and similarly JavaMembers holds all constructor types in ctorTypes array. The cached Class arrays are passed explicitly to methods that previously called getParameterType().
2003-07-06 19:07:00 +00:00
igor%mir2.org c1add24197 Cosmetics: use
import java.lang.reflect.*;
import java.io.*;

instead of explicit importing multiple classes.
2003-07-06 19:02:03 +00:00
igor%mir2.org 32619aac8e NativeJavaMethod.add is removed. It allows to assume that after NativeJavaMethod constructor methods array will remain the same, which I will use in the following patch to add caching of Method.getParameterTypes.
Instead of calling NativeJavaMethod.add, JavaMembers assemble the method list directly and then pass it to NativeJavaMethod when done.
2003-07-06 18:59:30 +00:00
igor%mir2.org 2dd779b626 Pass staticType to wrapAsJavaObject to restore an option to use it for reflection instead of dynamicType if a security manager prevents the later 2003-07-06 18:51:54 +00:00
igor%mir2.org 4b42da1dbb More JavaMembers cosmetics:
1. All its methods package private methods that are not accesible outside the class itself are made private.

2. Various package-private getters are removed in favor of direct field access.
2003-07-06 18:51:53 +00:00
igor%mir2.org 1c181334c2 1. Changing NativeJavaMethod.findFunction to return index of found method instead of the method itself to make smaller the following optimizations of findFunction.
2. Removal of NativeJavaMethod.getMethod that simply returned package-private field NativeJavaMethod.methods since the filed itself was accessed directly by other files.
2003-07-05 22:13:33 +00:00
igor%mir2.org 4fdc22f62d Added reportRuntimeError4 and getMessage4 to build 4-argument messages 2003-07-05 22:05:55 +00:00
igor%mir2.org 922f49f971 For compatibility, resurrect unwrap as deprecated method. 2003-07-03 18:51:16 +00:00
pschwartau%netscape.com ae38e3c537 Initial add. Regression test for bug 210682. 2003-07-02 23:43:09 +00:00
igor%mir2.org c922b2359b Added public FunctionObject.getMethodOrConstructor() to resolve
http://bugzilla.mozilla.org/show_bug.cgi?id=108719
2003-07-02 21:07:44 +00:00
igor%mir2.org b5dd8750a1 Do not store dynamic scope flag in the object. Instead when checking thisObj against Java this type use scope != getParentScope() to detect such usage. 2003-07-02 19:41:48 +00:00
igor%mir2.org df5af91220 Updating exception debugging to reflect changes due to http://bugzilla.mozilla.org/show_bug.cgi?id=210605 . 2003-07-02 16:37:29 +00:00
igor%mir2.org 10e5abd5a1 Reorganization of Java and JavaScript exception iteraction. See http://bugzilla.mozilla.org/show_bug.cgi?id=210605 for details. 2003-07-02 16:35:51 +00:00
igor%mir2.org 50093185e7 1. Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=102093 :
In NativeCall constructor adds argument object only if there is no parameters with this name and similarly do not set arguments to undefined if the function has "var arguments".

2. Split NativeCall into NativeCall and NativeCallPrototype to allow for smaller activation objects with faster property access.
2003-07-02 16:31:54 +00:00
igor%mir2.org e168d3f93a Cosmetics: end-of-line junk space removal 2003-07-01 07:18:07 +00:00
igor%mir2.org 78167b2c67 Teach Committing.generateCatchBlock() to generate catch blocks for EcmaError exceptions to avoid code duplication. 2003-06-30 20:21:32 +00:00
igor%mir2.org 0ca2f9239b The code to deal with caught Java exceptions and transfer control to script finally/catch is transfered to CATCH bytecode which is now always added to the and of script bytecode. In this way if Context.observeInstructionCount throws an exception, a proper cleanup to restore Interpreter runtime will still be carried out. It also allowed to transfer control directly to catch/finally code when script call throw instead of throwing Java exception just to capture it immediately.
This special CATCH bytecode is a simple way to workaround lack of goto in Java which makes writing interpreters more complex then necessary...
2003-06-30 19:31:44 +00:00
igor%mir2.org 387b707f61 Added ScriptRuntime.getCatchObject() for extracting JS object to pass as the argument to JS catch statement. 2003-06-30 19:21:41 +00:00
igor%mir2.org 6d1229405a Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=210682 :
A slightly modified version of Brian Gugliemetti fix for bad interaction in TokenStream.getToken()/peekTokenSameLine() when dealing with EOL.
2003-06-30 19:18:31 +00:00
igor%mir2.org 90c20109d8 Removal of deprecated DefiningClassLoader 2003-06-29 22:32:52 +00:00
igor%mir2.org b4b7524a24 Exception handling cleanup: use CATCH bytecode to extract JS object from Trowable so any exception that happens during this process will be handled properly. 2003-06-29 22:12:48 +00:00
igor%mir2.org f1f70ebd4e Cosmetics: removal of unused import 2003-06-29 21:58:01 +00:00
brendan%mozilla.org 0542fec384 Argh, inverted logic bug. 2003-06-28 00:55:12 +00:00
brendan%mozilla.org 4b1f9c1f48 Try to fix IRIX port bustage. 2003-06-28 00:09:25 +00:00
pschwartau%netscape.com c8fd7b2143 Adding 2 more sections. 2003-06-20 21:10:24 +00:00
pschwartau%netscape.com 676d30cf80 Improving comments. 2003-06-20 05:27:38 +00:00
pschwartau%netscape.com 27c2fd7dc5 Adding 2 more sections, and an explanation for the matches by Waldemar. 2003-06-20 05:23:06 +00:00
pschwartau%netscape.com 7c7bb79ec1 Improving comments. 2003-06-20 04:56:50 +00:00
pschwartau%netscape.com 5f4fd209a2 Improving comments. 2003-06-20 04:55:00 +00:00
dbradley%netscape.com f135a145fa Bug 205586 - IDispatch should convert VT_EMPTY as JSVAL_VOID and VT_NULL as JSVAL_NULL. r=adamlock, sr=alecf 2003-06-20 04:12:26 +00:00
dbradley%netscape.com d1bcd398fc Bug 204765 - Parameterized properties expression don't return the assigned value. r=adamlock, sr=alecf 2003-06-20 04:10:15 +00:00
dbradley%netscape.com 1e7ae8efa5 Bug 204894 - Implement GeckoActiveXObject.supports(clsid). r=dbradley, sr=alecf 2003-06-20 04:08:17 +00:00
pschwartau%netscape.com 795021a138 Correcting test per Waldemar at bug 209919 comment 11. 2003-06-20 00:40:01 +00:00
pschwartau%netscape.com 129f4eb65d Initial add. Regression test for bug 209919. 2003-06-19 21:26:19 +00:00
brendan%mozilla.org 97fe42fbbd Try to fix OSF1 (TRU64). 2003-06-19 04:43:23 +00:00
brendan%mozilla.org 165e8e03ac Try to fix OSF1 (TRU64). 2003-06-19 00:47:31 +00:00
pschwartau%netscape.com 120a3b71cf Adding a carriage return at end of file. 2003-06-17 21:32:48 +00:00
dbradley%netscape.com 5d58c9449f bug 203797 - IDispatch support should allow FUNC_VIRTUAL and FUNC_PUREVIRTUAL. r=adamloc, sr=alecf 2003-06-16 14:38:15 +00:00
brendan%mozilla.org b65cae1e34 Hack out ports that don't offer setenv. 2003-06-14 06:10:04 +00:00
pschwartau%netscape.com f88776bc0a Moving all catch guard tests from the ecma_3/Exceptions directory to the js1_5/Exceptions directory, since this is non-ECMA syntax. 2003-06-14 01:16:36 +00:00
brendan%mozilla.org 12de161f6f Try to fix HPUX bustage. 2003-06-14 00:10:09 +00:00
brendan%mozilla.org 1758ac34e1 Need jsconfig.h and #if JS_HAS_XDR...#endif around guts of file (208586, r=pschwartau). 2003-06-13 23:58:36 +00:00
brendan%mozilla.org e053dfcfc1 - Add an environment object, to reflect the shell's environment variables.
- Cleaned up command line argument processing so the arguments object is
  available to all scripts (-f foo.js or the final bar.js non-option arg).
  Also made - work in all cases (-f - or - as the final arg) to mean stdin.
- Miscellaneous formatting and style cleanup.
2003-06-13 21:25:10 +00:00
pschwartau%netscape.com 9bdc9ea55b Improving readability. 2003-06-13 18:09:45 +00:00
pschwartau%netscape.com 6b9c65b8d7 Improving readability. 2003-06-13 01:18:18 +00:00
pschwartau%netscape.com 288425ab00 Initial add. Regression test for bug 209067.js 2003-06-12 23:07:27 +00:00
brendan%mozilla.org 9abcc83528 Oops, this should have been checked in as part of the bug 208586 landing. 2003-06-12 00:26:40 +00:00
brendan%mozilla.org 05be1e35a2 More resolve cleanup: eliminate cx->resolving (redundant w.r.t. cx->resolvingTable && cx->resolvingTable->entryCount); use JS_DHASH_ADD and test for non-null key part, not LOOKUP-and-test-non-busy-then-ADD. 2003-06-11 23:43:56 +00:00