pschwartau%netscape.com
3b82ed70a1
Correcting testcase and adding more illustrative cases.
...
git-svn-id: svn://10.0.0.236/trunk@136024 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-08 22:51:02 +00:00
dbaron%dbaron.org
a53a959416
Bug 178643: Remove uses of NS_INIT_ISUPPORTS, since it is no longer needed. r=timeless sr=jag
...
git-svn-id: svn://10.0.0.236/trunk@136009 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-08 21:07:51 +00:00
pschwartau%netscape.com
2486f3726f
Adding comment.
...
git-svn-id: svn://10.0.0.236/trunk@135959 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-08 00:41:01 +00:00
brendan%mozilla.org
c4c7783814
Don't hold the GC lock when calling the GC callback (186592, r=shaver).
...
git-svn-id: svn://10.0.0.236/trunk@135946 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-07 21:56:52 +00:00
pschwartau%netscape.com
cfb190d2cd
Initial add. Regression test for bug 187133.
...
git-svn-id: svn://10.0.0.236/trunk@135904 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-06 22:18:34 +00:00
timeless%mozdev.org
4960240c75
Bug 187529 jsd init's a jscontext and doesn't release it (caught by res->input leak)
...
r=rginda sr=bryner
git-svn-id: svn://10.0.0.236/trunk@135849 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-04 22:47:44 +00:00
dbradley%netscape.com
d5e02d74fb
Bug 184491 - Security Manager blocks invoking methods on some IDispatch based objects. r=adamlock, sr=jst
...
git-svn-id: svn://10.0.0.236/trunk@135817 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-03 15:48:20 +00:00
seawood%netscape.com
0a7c7a98f9
nobrainer changes while thinking about mingw support
...
Bug #134113 r=dmose
git-svn-id: svn://10.0.0.236/trunk@135809 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-03 08:58:59 +00:00
nboyd%atg.com
e0e95edda1
Update for RC2
...
git-svn-id: svn://10.0.0.236/trunk@135754 18797224-902f-48f8-a5cc-f745e15eee43
2003-01-01 20:17:17 +00:00
igor%mir2.org
3262cffc0f
Deprecating ClassOutput in favor of ClassRepository and Context methods to access ClassNameHelper functionality in favor of directly calling ClassNameHelper methods. For that I changed ClassNameHelper from interface to abstract class and added ClassNameHelper.get(Context cx) method to get name helper object that is used for the given Context object.
...
git-svn-id: svn://10.0.0.236/trunk@135737 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-31 18:21:32 +00:00
igor%mir2.org
b495cd03a1
Allow application to customize class loader used for loading generated code.
...
For that I added new method createClasssLoader to Context, which by default returns new instance of DefiningClassLoader and changed the code to use this method instead of creating DefiningClassLoader directly. I moved DefiningClassLoader to org.mozilla.javascript package so core Rhino classes would not depend on org.mozilla.classfile package. I also changed SecurityController.createClasssLoader to take additional parentLoader argument to explicitly specify which class loader should be parent for generated code.
git-svn-id: svn://10.0.0.236/trunk@135730 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-31 09:42:42 +00:00
igor%mir2.org
2ec8fc7016
Eliminating calls to Thread.getContextClassLoader().
...
From my mail to Norris Boyd:
When considering http://bugzilla.mozilla.org/show_bug.cgi?id=166530 I realized that my 2 years old suggestion to use Thread.getContextClassLoader() in org.mozilla.classfile.DefiningClassLoader was wrong, as it does not follow class loader chain pattern Rhino embeddings can use. Moreover, it is wrong to use Thread.getContextClassLoader() when searching for Rhino classes as if Rhino is available via the system class loader and an application uses its copy from another loader, Thread.getContextClassLoader() would return incompatible class while simple Class.forName() would do proper job of loading the requested class from a loader of Class.forName() caller.
The only place where Thread.getContextClassLoader() can be useful is when searching for classes in NativeJavaPackage, but even there with a new option to use Package with an explicit class loader argument it is not necessary as one can write in a script
Packages(java.lang.Thread.contextClassLoader) to get necessary behavior.
git-svn-id: svn://10.0.0.236/trunk@135711 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-30 18:22:58 +00:00
igor%mir2.org
7a60bfa650
Replace ScriptRuntime#main(String scriptClassName, String[] args) by ScriptRuntime#main(Class scriptClass, String[] args) and to optimizer.Codegen#generateMain code to generate call to Class.forName before calling ScriptRuntime#main. In this way script byte code can access Class object if generated script is loaded via different class loader then Rhino classes.
...
git-svn-id: svn://10.0.0.236/trunk@135695 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-30 06:49:10 +00:00
igor%mir2.org
1eae44d903
When checking for a nested class, try to load it from class loader for the parent class, not from the loader for Rhino classes.
...
git-svn-id: svn://10.0.0.236/trunk@135690 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-30 00:50:57 +00:00
igor%mir2.org
537ebbebd0
Move code to try to load a class from getPkgProperty to the separated findClass method and add catching of SecurityException there.
...
git-svn-id: svn://10.0.0.236/trunk@135689 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-30 00:49:11 +00:00
igor%mir2.org
9238213337
Change FunctionObject to extends BaseFunction, not NativeFunction as the later is more tailored for function representing JavaScript code.
...
git-svn-id: svn://10.0.0.236/trunk@135688 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-30 00:43:33 +00:00
igor%mir2.org
b4d957a36d
To map a class name to the corresponding Class instance from the adapter code generate code to call Class.forName instead of calling ScriptRuntime.loadClassName so a class loader for the generated code will be used to access the Class instance, not the loader for the Rhino classes.
...
git-svn-id: svn://10.0.0.236/trunk@135684 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-29 20:21:06 +00:00
igor%mir2.org
18237dcd78
In createInvoker I replaced classLoader.loadClass by classLoader.linkClass to remove catching ClassNotFoundException
...
git-svn-id: svn://10.0.0.236/trunk@135682 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-29 10:52:10 +00:00
igor%mir2.org
ca16420186
Fixing design flaw in SecurityController:
...
The new SecurityController in its current form does not allow to define more then one generated class class in the same class loader effectively preventing to use optimizer which needs to define classes that refer each other and should be defined in the same loader.
To fix this I replaced the defineClass method in SecurityController by
public GeneratedClassLoader createClassLoader(Object securityDomain);
which returns instance of the new GeneratedClassLoader interface which can be used to define several classes. I also made DefiningClassLoader to implement this interface to simplify code in JavaAdapter.java and optimizer/Codegen.java.
git-svn-id: svn://10.0.0.236/trunk@135668 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-28 05:37:43 +00:00
seawood%netscape.com
f8f86e7f05
Start installing GRE libraries & components into a separate dist/gre directory as part of the default build.
...
Bug #186241 r=dougt
git-svn-id: svn://10.0.0.236/trunk@135661 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-28 01:15:07 +00:00
igor%mir2.org
ca96f33b4c
Preparations for 1.5R4 release
...
git-svn-id: svn://10.0.0.236/trunk@135603 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-24 01:34:45 +00:00
igor%mir2.org
ff75833db8
Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=184107
...
Always put function expression statements into initial activation object ignoring the with statement to follow SpiderMonkey
git-svn-id: svn://10.0.0.236/trunk@135592 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-23 15:01:53 +00:00
igor%mir2.org
8da562678c
Mostly cosmetics: use consistent naming for new API for function object initialization.
...
git-svn-id: svn://10.0.0.236/trunk@135591 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-23 14:56:58 +00:00
igor%mir2.org
b8d1156a30
Eliminate double creation of Function objects representing nested functions in scripts/functions and use ScriptRutime.putFunction to bind function objects with activation scope.
...
git-svn-id: svn://10.0.0.236/trunk@135576 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-22 22:39:10 +00:00
igor%mir2.org
f643a85175
Use Context.enter() try { } finally { Context.exit() } instead of try { Context.enter() } finally { Context.exit() } as Context.exit should only be called if Context.enter() returns successfully.
...
git-svn-id: svn://10.0.0.236/trunk@135573 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-22 19:12:50 +00:00
igor%mir2.org
613922e569
Move code to put functions as properties of activation object to ScriptRuntime.putFunction so it can reused by optimizer.
...
git-svn-id: svn://10.0.0.236/trunk@135572 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-22 19:08:52 +00:00
igor%mir2.org
02a3104fd2
Do not put "anonymous" into BaseFunction.functionName for functions created via new Function. Instead NativeFunction.getFunctionName() returns "anonymous" for function name for such functions which allows to assume that BaseFunction.functionName always holds real name.
...
git-svn-id: svn://10.0.0.236/trunk@135571 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-22 19:06:26 +00:00
igor%mir2.org
f1b2ffe463
I replaced exception handlers for InstantiationException and friends during Class/Constructor.newInstance calls to construct NativeFunction/NativeScript instances via single catch (Exception ex) as the handlers rethrow exceptions as RuntimeException in any case. As it reduces OptRuntime.newOptFunction to few lines, its single usage in Codegen is inlined.
...
git-svn-id: svn://10.0.0.236/trunk@135563 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-22 02:51:16 +00:00
igor%mir2.org
0d3a09f775
I removed constants denoting _QUICK bytecodes as valid bytecode can not contain them. To catch possible bugs with passing invalid opcode I also replaced extra, opcodeCount and stackChange arrays by functions with switch statements that throws IllegalArgumentException on bad opcode. It also has an advantage of reducing class file size due to lack of support in JVM for efficient array initialization.
...
git-svn-id: svn://10.0.0.236/trunk@135562 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-22 02:42:40 +00:00
igor%mir2.org
9bf6180e3f
I removed dependency of Parser.decompile on NativeFunction. Now Parser.decompile takes as argument a tree structure describing encoded source for script or function and their nested functions. In case of interpreter the tree is built from interpreter runtime data while the optimizer puts a static function to construct tree into the class file representing compiled script or function. This function is called via reflection.
...
The change removes the need to have instances of NativeFunction representing nested functions constructed before they are needed as a part of script execution.
git-svn-id: svn://10.0.0.236/trunk@135545 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-21 12:43:55 +00:00
brendan%mozilla.org
c339a9649c
Fixed so overriding Function.prototype.toSource doesn't mess up F.p.toString output, which should decompile the function, including nested function expressions (178389, r=shaver).
...
git-svn-id: svn://10.0.0.236/trunk@135535 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-21 02:14:53 +00:00
igor%mir2.org
7e75720a44
I removed code to add EmptyArray field to generated field in Codegen.generateInit as it was redundant to ScriptRuntime.emptyArgs
...
git-svn-id: svn://10.0.0.236/trunk@135525 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-20 16:14:51 +00:00
igor%mir2.org
c4a837926f
In Codegen.visitFunction I replaced code generating call to createFunctionObject that would use reflection to instantiate function object by a direct calling of function constructor and a separated call to function initialization in OptRuntime.setupFunction.
...
git-svn-id: svn://10.0.0.236/trunk@135519 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-20 12:21:35 +00:00
igor%mir2.org
d76676a3d9
I removed debug_level and debug_srcName fields as they are never used.
...
git-svn-id: svn://10.0.0.236/trunk@135518 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-20 12:12:41 +00:00
igor%mir2.org
72fa19bc20
I moved optimizer related code to initialize a function from ScriptRuntime to optimizer/OptRuntime and replaced common code to initialize function prototype and scope in few places by ScriptRuntime.initFunction
...
git-svn-id: svn://10.0.0.236/trunk@135499 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-19 19:48:55 +00:00
rginda%netscape.com
c32dc4620e
bug 185719, r=peterv@netscape.com, sr=brendan@mozilla.org
...
"add ability to get at function object for a jsdIScript"
add a |functionObject| attribute to the jsdIScript interface, which returns the function's JSObject as a jsdIValue
git-svn-id: svn://10.0.0.236/trunk@135432 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-17 22:22:30 +00:00
igor%mir2.org
f1c3ea40ba
Cosmetics: expanding tabs
...
git-svn-id: svn://10.0.0.236/trunk@135420 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-17 20:56:08 +00:00
igor%mir2.org
020637d3cc
Cosmetics: removal of junk white-space at line end
...
git-svn-id: svn://10.0.0.236/trunk@135418 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-17 20:48:35 +00:00
igor%mir2.org
7be1490413
I replaced all ScriptableObject.getClassPrototype(scope, "Function") by ScriptableObject.getFunctionPrototype(scope)
...
git-svn-id: svn://10.0.0.236/trunk@135405 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-17 16:36:23 +00:00
igor%mir2.org
861a43f494
I moved details of debugger API changes since 1.5R3 to a separated document.
...
git-svn-id: svn://10.0.0.236/trunk@135397 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-17 09:26:48 +00:00
pschwartau%netscape.com
eeee2c78f1
Adding more comments.
...
git-svn-id: svn://10.0.0.236/trunk@135379 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-17 01:54:54 +00:00
pschwartau%netscape.com
5a4ba94c0c
Initial add. Regression test for bug 185485.
...
git-svn-id: svn://10.0.0.236/trunk@135378 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-17 01:41:34 +00:00
nboyd%atg.com
a6d2c8e2e2
Add link to release candidate.
...
git-svn-id: svn://10.0.0.236/trunk@135350 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-16 16:51:33 +00:00
igor%mir2.org
037e9fa97c
Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=181834
...
Ignore dynamic scope flag for nested functions and functions defined inside with statements
git-svn-id: svn://10.0.0.236/trunk@135306 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-14 18:56:27 +00:00
pschwartau%netscape.com
93579c0475
Initial add. Regression test by igor@icesoft.no for bug 185165.
...
git-svn-id: svn://10.0.0.236/trunk@135288 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-14 02:33:58 +00:00
pschwartau%netscape.com
eadfe426e2
Improving readability.
...
git-svn-id: svn://10.0.0.236/trunk@135262 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-13 21:40:32 +00:00
igor%mir2.org
07e3ee8c09
*** empty log message ***
...
git-svn-id: svn://10.0.0.236/trunk@135254 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-13 18:26:31 +00:00
igor%mir2.org
57a2f16de5
*** empty log message ***
...
git-svn-id: svn://10.0.0.236/trunk@135251 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-13 18:16:12 +00:00
igor%mir2.org
3b0b840f47
Document update
...
git-svn-id: svn://10.0.0.236/trunk@135249 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-13 14:21:38 +00:00
igor%mir2.org
06f9755b5e
Fix for http://bugzilla.mozilla.org/show_bug.cgi?id=185165
...
I made ScriptRuntime.escapeString to escape \ and remove code to escape single quote ' as it is unreachable due to if (' ' <= c && c <= '~' && c != '"' && c != '\\') check as ' should not be escaped.
git-svn-id: svn://10.0.0.236/trunk@135242 18797224-902f-48f8-a5cc-f745e15eee43
2002-12-13 11:56:54 +00:00