igor%mir2.org
83c4281829
In Object.toSource implementation if property is not valid Java identifier, print it as 'escaped_property' so the property will read as proper Java string.
2003-12-04 15:47:03 +00:00
igor%mir2.org
0c0de954e0
Fixing bug 225831 : use before_225831_merge to get code before the far reaching fix
2003-12-04 14:41:22 +00:00
igor%mir2.org
a6a8326e8e
Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=226045 :
...
(new RegExp).toString/toSource() now gives /(?:)/ instead of // which is comments and does not work with uneval.
2003-11-24 15:51:44 +00:00
igor%mir2.org
b1b179e241
Fixing debug printout of icode: CALLSPECIAL prinout was not updated to reflect proper value of only 6 additional bytes for bytecode.
2003-11-17 18:31:55 +00:00
igor%mir2.org
b27a94884b
To mark special properties __proto__ and __parent__ in parse tree use integer ids instead of strings so it is easier to check tree consitency.
2003-11-17 17:39:43 +00:00
igor%mir2.org
e6d6ac22c0
Finalizing toSource() support: do not put () arround {} for source representation of objects that are part of recursive toSource call.
...
For details, see http://bugzilla.mozilla.org/show_bug.cgi?id=225465
2003-11-17 17:37:21 +00:00
igor%mir2.org
910736ea5d
Changing wrapping of caught Java exceptions: now they are constructed with JavaException constructor, have fileName, lineNumber defined to point to script line that executed Java code triggering exception and have javaException property pointing to the wrapped exception object.
...
For details, see http://bugzilla.mozilla.org/show_bug.cgi?id=225817
2003-11-17 11:04:29 +00:00
igor%mir2.org
b5a9ce9cef
Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=225817 :
...
Proper support for fileName and lineNumber in Error objects.
2003-11-17 09:45:01 +00:00
igor%mir2.org
0b06306238
Allow for scripts to catch instances of EvaluatorException
2003-11-14 20:38:06 +00:00
igor%mir2.org
25d8b12206
Transform StackOverflow during parsing into runtime exception so script can detect too deep recursion during parsing.
2003-11-14 20:33:43 +00:00
igor%mir2.org
c9206ad473
Splitting Token.ASSIGN into Token.ASSIGN and Token.ASSIGNOP where the former represents only = while ASSIGNOP is used to denote +=, -= etc. Parse tree for the 2 operations is rather different and split allowed to simplify IRFactory code.
2003-11-14 16:03:31 +00:00
igor%mir2.org
5a212182d3
Implementing uneval/toSource functionality of SpiderMonkey. Foe details, see http://bugzilla.mozilla.org/show_bug.cgi?id=225465 .
2003-11-13 17:15:31 +00:00
igor%mir2.org
1abb22cbea
Passing to decompiler information about function type so it can use it to customize its output in future.
2003-11-12 15:47:50 +00:00
igor%mir2.org
fa80cda516
Changing Decompiler.decompile to take just encoded source, flag argument controlling output format and property table so it would be possible to add more options to decompiler without changing the rest of code.
2003-11-12 12:22:12 +00:00
igor%mir2.org
86b7ac3792
Changing return type of NativeFunction.getEncodedSource() to String from Object since the idea of having anything else but String would require changes in API in any case.
2003-11-12 10:23:53 +00:00
igor%mir2.org
5d88d5ee75
In ClassFileWriter.addPush(double) use DNEG to generate more compact code for -0.0 and -1.0
2003-11-11 20:31:36 +00:00
igor%mir2.org
f725ff1f29
Changing just introduced CodeBlock into Callable that define call method with exactly the same signature as Function.call and changing Function to extend Callable.
...
Now Context defines new method "call" that provide optimized version of the following code:
Context cx = Context.enter()
try {
callable.call(cx, scope, thisObj, args);
} finally {
Context.exit();
}
Since Function extends Callable, it can be passed to this method directly thus simplifying ScriptableObject.call method and Java adapter code.
The new interface is used in SecurityController implementation which allows to pass interpreted functions there directly as well removing the need to have intermediate class in Interpreter.
2003-11-11 20:30:08 +00:00
igor%mir2.org
58376ed098
Extend constant folding to cover few unary operations
2003-11-11 20:18:34 +00:00
igor%mir2.org
2c6037d9bd
1. Make sure that -0.0 from parser are treated properly: new constant folding code there may produce it.
...
2. Instead of generating code to call Double constructor use the new method OptRuntime.wrapDouble() that allows to cut amount of produced byte code.
2003-11-11 20:04:38 +00:00
igor%mir2.org
6e1ba2e3df
Patch from Dave Russo to wrap arguments array properly: the code has to allocate new Object[] array since Context.newObject needs instances of Object[], not SomeObjectSubclass[], to work properly.
2003-11-10 02:18:11 +00:00
igor%mir2.org
a972b38a3a
Check in Context.newArray(Scriptable scope, Object[] elements) that elements is instance of Object[] and not SomeObjectSubclass[] to expose broken usage of newArray as soon as possible.
2003-11-10 02:14:37 +00:00
igor%mir2.org
a96da1a17f
Changes in Security API: using CodeBlock interface instead of reusing Script to represent code that should be executed with different domain.
2003-11-07 22:29:59 +00:00
igor%mir2.org
d3c70a3cd8
New interface to refer to code executed with a particular context and arguments.
2003-11-07 22:28:22 +00:00
igor%mir2.org
9fe0c80278
1. Removal of very recently introduced hideFromContextListeners: it was a wrong solution to the problem of running scripts under independent Context instances on the same thread.
...
2. Optimization of Context.enter()/Context.exit() when ThreadLocal is available:
Store Context[1], not Context in the variable so Context.enter()/Context.exit() would need to access ThreadVar only once and then update the reference.
2003-11-07 22:24:53 +00:00
igor%mir2.org
0a9166fe3a
Added setDouble, setString that are used in IRFactory during constant folding
2003-11-07 22:18:49 +00:00
igor%mir2.org
7d5922f48f
Move all contant folding logic to IRFactory where it simpler to do and possible to reuse tree nodes during folding.
2003-11-07 22:17:54 +00:00
igor%mir2.org
2be95ba6cd
Do constant folding during parsing since it is cheap to do that at this stage then in optimizer during separated phase so even the interpreter will take advantage of the folding.
2003-11-07 15:58:57 +00:00
igor%mir2.org
fd70d98f29
ClassRepository is removed from list of API classes to allow to replace it in future by direct access to optimizer.
2003-11-04 14:55:58 +00:00
igor%mir2.org
ecad46eb8f
Adjusting examples not to assume that Context.initStandardObjects(ScriptableObject) returns ScriptableObject since that was changed back to Scriptable for compatibility.
2003-11-04 14:54:43 +00:00
igor%mir2.org
56959e7696
Removal of initStandardObjects(boolean) not to proliferate versions of initStandardObjects: if Rhino would support recursive object sealing, it would not be necessary to call initStandardObjects with sealed flag at all.
2003-11-04 14:52:48 +00:00
igor%mir2.org
0e92e06301
JavaDoc @link fixes
2003-11-04 14:49:20 +00:00
igor%mir2.org
56cd62465f
Return type of Context.initStandardObject(ScriptableObject) is changed back to Scriptable for binary compatibility.
2003-11-03 20:42:32 +00:00
igor%mir2.org
011d5fcfd1
Removal of possibility to alter JavaAdapter through an external property as such functionality is redundant and can be emulated with altering JavaAdapter in the scope object after Context.initStandardObjects returns.
2003-11-03 19:58:17 +00:00
igor%mir2.org
8844a1f96b
Use reflection to access JavaAdapter to allow to use NativeJavaObject with JavaAdapter classes absent.
2003-11-03 19:55:37 +00:00
igor%mir2.org
0bbeb14dff
When converting function to Java interface and checking for the previous wrapping, do not use key stored in ClassCache.javaAdapterIFGlueMasters as it can be thrown away when caches are emptied and instead construct a key object from the passed class and uniqueness tag.
2003-11-03 18:15:00 +00:00
igor%mir2.org
6a865fc062
In NativeJavaClass.constructSpecific use passed scope, not function pointer as scope source so shared system scope with custom top scope and custom wrap factory would work.
2003-11-03 18:06:49 +00:00
igor%mir2.org
d2c27acd1a
Added Kit.makeHashKeyFromPair to make combined key for hashtables from 2 objects
2003-11-03 18:04:27 +00:00
igor%mir2.org
f9931a4665
Added Context.javaToJS as a convenient way to get JS values from Java objects and Context.emptyArgs so documentation does not need to refer to ScriptRuntime.emptyArgs.
2003-11-02 21:15:14 +00:00
igor%mir2.org
970fe84f50
In WrapFactory.wrap use String.valueOf(charValue) instead of new String(new char[] { charValue }) to get string from character.
2003-11-02 21:12:08 +00:00
igor%mir2.org
ea9b76f64c
Deprecation of get/setAttributes forms that take start argument. It was never used to pass anything but this object.
2003-11-01 20:23:28 +00:00
igor%mir2.org
4c360b0900
Since Undefined inherits from Scriptable, not ScriptableObject, it does not need to override get/setAttributes()
2003-11-01 20:21:28 +00:00
igor%mir2.org
2102257103
Removal of completely unnecessary getSlotToSet as its implementation repeated already unsuccessfully search done by getSlot. The put methods now call addSlot directly.
...
In addition, shared code in has and get to check/update lastAccess cache is moved to common method getNamedSlot.
2003-11-01 19:40:24 +00:00
igor%mir2.org
5294159feb
GlobalScope is removed as its introduction had to serious consequences with compatibility and usage. Instead a special purpose class ClassCache is introduces to hold various caches. The class binds itself to an arbitrary object by using new SciptableObject.associateValue method so arbitrary ScriptableObject can be used as a scope without performance penalties.
2003-11-01 15:34:23 +00:00
igor%mir2.org
15fc231809
parent and prototype fields are made privatenot to allow to mess with them from subclasses. Althoygh setter and getter can be used still to do that, at least some sanity checks can be added there.
2003-10-30 16:40:43 +00:00
igor%mir2.org
e12e6f2269
Use getPrototype instead of explicit reference to this.prototype
2003-10-30 16:40:42 +00:00
igor%mir2.org
a123fd228b
passing Context instance to NativeJavaMethod.findMethod not to call Context.getContext() id some form of API to override method selection will surface
2003-10-30 16:40:41 +00:00
igor%mir2.org
ea873cadc1
Added readReader
2003-10-30 16:40:40 +00:00
igor%mir2.org
c0c59dd572
Not to call Context.getContext() in TokenStrea/IRFactory, an explicit Context instance is passed to TokenStream constructor
2003-10-30 16:40:39 +00:00
igor%mir2.org
e0c6b113b2
Use passed scope instead of the object parent scope
2003-10-30 16:39:46 +00:00
igor%mir2.org
22d09dcc14
First part of resolving http://bugzilla.mozilla.org/show_bug.cgi?id=223435 :
...
Allow to pass JS function to Java method accepting interface with single method. The function will be called when interface method will be called.
2003-10-28 08:37:30 +00:00