Commit Graph

161 Commits

Author SHA1 Message Date
igor%mir2.org
985134c0ed 1. Replacing IdScriptableObject.wrap_* methods by their ScriptRuntime.wrap* counterparts since the wrap methods are useful not only for subclasses of IdScriptableObject.
2. Reorganizing execIdCall in few classes inherited from IdScriptableObject to shrink code size.
2004-09-10 18:02:06 +00:00
igor%mir2.org
db8822eccc Removal of "throws JavaSriptException" declaration:
JavaSriptException now inherits from RhinoException which inherits from RuntimeException and as such it does not necessary to declare it.

Moreover, it is wrong to use it for the documentation purpose since a  script can also throw EcmaError and WrappedException and a proper documentation would require to document those exceptions as well. But since almost all Rhino functions can potentially execute script code it means that wast majority of functions would bear the declarations, not only code overriding or calling explicitly Function.call/construct. And then the throw declarations would bring no information if it always would be "throws RhinoException". Thus it is better not to litter sources with the declarations at all.
2004-09-08 12:29:59 +00:00
igor%mir2.org
30e63c4179 Fixing bug 258144: my take on patch patch from Andrew Madigan <andymadigan@yahoo.com> to add class compiler option controlling which class will be used for main method implementation. 2004-09-07 19:11:39 +00:00
igor%mir2.org
c7b18deb40 Deprecating PropertyException as a part of common exception root changes, see 244492. 2004-08-14 16:45:30 +00:00
igor%mir2.org
eed65b7987 Using Kit.initCause to wrap the original exception preventing creation of SecurityController class. 2004-08-14 16:42:33 +00:00
igor%mir2.org
8a6fdf912e Fixing missed context wrapping in debugger/Dim and proper button enable/dosable in debugger/DebugGui 2004-07-29 12:51:35 +00:00
igor%mir2.org
43d1beb31a Renaming StringIdMap to Main and ipdating documentation 2004-07-29 10:44:59 +00:00
igor%mir2.org
0659e0b714 Committing E4X parser and runtime proxies: see enhancement report 242805.
This is based on code contributed to Rhino by AgileDelta, Inc, www.agiledelta.com and in particular by

Ethan Hugg
Terry Lucas
Milen Nankov
John Schneider

Thanks!
2004-07-28 21:11:02 +00:00
igor%mir2.org
f32fceb8a1 Deprecation of ContextListener in favour of ContextFactory.Listener:
the later is stored in the factory and not in static variables.
For compatibility an instance of ContextFactory stored in static variables
is used to provide support for old Context.addContextListener etc. API.

The static instance of the factory is also used by Context.enter to create
Context instances providing simple way to customize Context: one just need
to initialize the global static factory.
2004-06-30 15:23:39 +00:00
igor%mir2.org
012fd05901 Fix menu enable/disable misbehavior. 2004-06-30 13:29:41 +00:00
igor%mir2.org
4cc8c9cd28 Fixing JDK 1.3 compatibility: TableModel.getRot() should not return null there. 2004-06-30 09:38:54 +00:00
igor%mir2.org
b538849b5b Work on bug 244492: RhinoException is the new common base class for all exceptions. 2004-06-07 16:40:28 +00:00
igor%mir2.org
daf6b75edb Introduction of ContextAction interface as a safe alternative for Context.enter/Context.exit. All usages of Context.enter/Context.exit in Rhino are replaced by
Context.call(new ContextAction() {
	public Object run(Context cx) { ... }
});
or similar alternatives.

It prevents bugs with missed Context.exit and provides room for optimization of Context association with current thread and simplify implementation of safe environment for execution of untrusted applets and scripts.

In addition, Rhino now supports global SecurityController that take precedence over any per/Context controllers so the application can setup the controller once and for all.
2004-06-06 15:33:59 +00:00
igor%mir2.org
6dcea14f54 Patch from Merten Schumman <Merten.Schumman@asg.com> to add Main.mainEmbedded(String) which is a version of Main.main without System.in/err/out redirection. It simplifies life for embeddings. 2004-05-28 14:19:11 +00:00
igor%mir2.org
402fd02406 Final implementation of GUI/debug implementation internals separation. Now the newly introduced Dim.java (Dim: Debug IMplementation) depends only on GuiCallback and contains all iteractions with Rhino. 2004-05-27 11:26:59 +00:00
igor%mir2.org
7fe01ad6bc exitAction is moved to DebugGui 2004-05-27 10:34:44 +00:00
igor%mir2.org
cd63019db8 Prepare to remove dependancy of core debugger implementation on GUI: introduction of GuiCallback interface that DebugGui implements. 2004-05-27 10:21:24 +00:00
igor%mir2.org
b85ecb8c02 Work on 244492: JavaScriptException extends RuntimeException 2004-05-26 11:54:10 +00:00
igor%mir2.org
1e8e9be624 1. Reorganize debugger to move all code that interacts with the engine into Main.java while all GUI logic now presents in DebugGui
2. Move downloaded files for swing tree table into downloaded directory and adjust build files accordingly.
2004-05-23 16:15:09 +00:00
igor%mir2.org
cfe01facb2 Make sure that for Rhino-generated exceptions Throwable.getMessage() contains script file and line information. 2004-05-23 14:32:07 +00:00
igor%mir2.org
30e9aee832 Switch to line info extraction through single top script processing 2004-05-22 23:19:56 +00:00
igor%mir2.org
677ac1cd76 Splitting Main.java into Main.java and GUI-related DebugGui.java 2004-05-21 15:06:36 +00:00
igor%mir2.org
7ceadc8e69 Split Main class into Main and DebugGui to have better debugger/gui separation 2004-05-21 14:25:21 +00:00
igor%mir2.org
1ad8dc2197 Move all logic to open source window at the end of compilation to single update action. 2004-05-21 12:04:47 +00:00
igor%mir2.org
e58d2a671b Move logic to show exception dialog into EnterInterrupt action 2004-05-21 11:27:59 +00:00
igor%mir2.org
7706f20db2 Test file 2004-05-21 10:53:19 +00:00
igor%mir2.org
5c690d13af I changed StackFrame.onLineChange to access breakFlag directly which allowed to remove global context hashtable 2004-05-21 01:20:48 +00:00
igor%mir2.org
261666150e Merge various GUI initializations during breakpoint hit into single action 2004-05-21 01:10:04 +00:00
igor%mir2.org
0ec2c999de Removal of manThread: breakFlag can do its job just fine 2004-05-21 00:17:45 +00:00
igor%mir2.org
9f73c42235 Replace Context switching during eval for interrupted threads by thread communication so all evals happens on the original thread. 2004-05-21 00:11:24 +00:00
igor%mir2.org
f4ff06f911 Making BaseFunction.decompile package private: any new public function will always find its users even if the usage is broken. It was public to allow calls from debugger but simple call to Context.toString() would do the same job. 2004-03-18 13:37:29 +00:00
igor%mir2.org
b629e258d7 optimizer.ClassCompiler provides new simple API for generating of class files from scripts that does not require to create Context instances.
The jsc tool is updated to use the new interface instead of using ClassNamehelper and friends.
2004-01-17 21:02:32 +00:00
igor%mir2.org
96ea5ea515 Patch from Alex Bitney to fix bug 230883 2004-01-15 20:10:54 +00:00
igor%mir2.org
32ebb1d38d Dropping scope argument from Context.compileString/compileReader since it is no longer used as Script instances are scope independent.
For compatibility the old form of Context.compileReader is preserved but marked as deprecated.
2003-12-25 22:37:57 +00:00
igor%mir2.org
f2ba87fed2 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
f260baaf11 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
8313023fae 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
dc34ed3dc1 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
16dcc44df0 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
368bd47f1e Introduction of org.mozilla.javascript.Kit to contain generic support utilities. 2003-10-21 13:43:22 +00:00
igor%mir2.org
31bc498af4 Added readUrl method to shell 2003-10-21 09:13:59 +00:00
igor%mir2.org
c7382925ac Changing Main.eval implementation to use compileString/exec instead of evalString to avoid dependancy on NativeGlobal when passing explicit thisObj to Script instances when they implement Function interface which holds currently in Rhino. 2003-09-12 17:12:20 +00:00
igor%mir2.org
ca657b86ae Siplified code to extract error message from Throwable to reflect recent changes in exception-related API semantics. 2003-09-11 15:41:06 +00:00
igor%mir2.org
8a8ca75068 Adding readFile function to the shell to read file context. 2003-08-11 10:54:40 +00:00
igor%mir2.org
d153c65a1b build.xml reorganization to add deepclean, clean and help targets and making help a default target, see for details http://bugzilla.mozilla.org/show_bug.cgi?id=214997 2003-08-06 07:47:58 +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
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
fde9643eed Addition of seal function to Rhino shell to seal all supplied arguments. 2003-05-19 15:53:23 +00:00
igor%mir2.org
3f84d7fe70 Resolving http://bugzilla.mozilla.org/show_bug.cgi?id=203013 :
Changing behavior of sealed objects to throw an exception on any attempt to modify them including changing values of existing properties. In the same time making object sealed does not affect read-only status of its properties which allows to override properties of objects with a sealed object as a prototype.

Rhino shell now accepts -sealedlib option to seal all standard objects.
2003-05-16 14:25:57 +00:00
nboyd%atg.com
09fe5de968 Fix bug 202344 (which was not fully fixed by the previous change.) 2003-04-21 19:43:45 +00:00