261 Commits

Author SHA1 Message Date
igor%mir2.org
790007841c 1. Ignoring recursive invocation of Dim.interrupted on event thread: when Gui
processes breakpoint hit and another breakpoint is met during event processing,
then on Linux recursive invocations of EventQueue.getNextEvent()/dispatchEvent
lead to eventual GUI deadlock. It is easy to observe when the break on function
enter is enabled and a JS function is called that is attached to an action
handler of some button. With recursive bahaviour repeated clicks lead to deeper
and deeper invocation of EventQueue.getNextEvent() and GUI deadlock on Linux.

So to improve debugger stubility I modify Dim.interrupted to ignore calls from
event thread when another invocation of Dim.interrupted already waits for GUI
result.

2. To decrease class and jar bloat I merges various implementations of Runnable
and and other interfaces to single class with switch dispatch. It saved about
6K from js.jar.


git-svn-id: svn://10.0.0.236/trunk@162361 18797224-902f-48f8-a5cc-f745e15eee43
2004-09-15 14:45:10 +00:00
igor%mir2.org
4e0bdf0286 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.


git-svn-id: svn://10.0.0.236/trunk@162092 18797224-902f-48f8-a5cc-f745e15eee43
2004-09-10 18:02:06 +00:00
igor%mir2.org
a5563f388c 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.


git-svn-id: svn://10.0.0.236/trunk@161917 18797224-902f-48f8-a5cc-f745e15eee43
2004-09-08 12:29:59 +00:00
igor%mir2.org
515f364a35 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.
git-svn-id: svn://10.0.0.236/trunk@161864 18797224-902f-48f8-a5cc-f745e15eee43
2004-09-07 19:11:39 +00:00
igor%mir2.org
4fb35c7990 Deprecating PropertyException as a part of common exception root changes, see 244492.
git-svn-id: svn://10.0.0.236/trunk@160765 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-14 16:45:30 +00:00
igor%mir2.org
736c8aa7e1 Using Kit.initCause to wrap the original exception preventing creation of SecurityController class.
git-svn-id: svn://10.0.0.236/trunk@160764 18797224-902f-48f8-a5cc-f745e15eee43
2004-08-14 16:42:33 +00:00
igor%mir2.org
71bcd48015 Fixing missed context wrapping in debugger/Dim and proper button enable/dosable in debugger/DebugGui
git-svn-id: svn://10.0.0.236/trunk@160048 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-29 12:51:35 +00:00
igor%mir2.org
38997197fb Renaming StringIdMap to Main and ipdating documentation
git-svn-id: svn://10.0.0.236/trunk@160042 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-29 10:44:59 +00:00
igor%mir2.org
74d289c7cf 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!


git-svn-id: svn://10.0.0.236/trunk@159991 18797224-902f-48f8-a5cc-f745e15eee43
2004-07-28 21:11:02 +00:00
igor%mir2.org
4dae7d8134 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.


git-svn-id: svn://10.0.0.236/trunk@158605 18797224-902f-48f8-a5cc-f745e15eee43
2004-06-30 15:23:39 +00:00
igor%mir2.org
d9b5214238 Fix menu enable/disable misbehavior.
git-svn-id: svn://10.0.0.236/trunk@158601 18797224-902f-48f8-a5cc-f745e15eee43
2004-06-30 13:29:41 +00:00
igor%mir2.org
dee3dab0cc Fixing JDK 1.3 compatibility: TableModel.getRot() should not return null there.
git-svn-id: svn://10.0.0.236/trunk@158600 18797224-902f-48f8-a5cc-f745e15eee43
2004-06-30 09:38:54 +00:00
igor%mir2.org
f0931bf120 Work on bug 244492: RhinoException is the new common base class for all exceptions.
git-svn-id: svn://10.0.0.236/trunk@157511 18797224-902f-48f8-a5cc-f745e15eee43
2004-06-07 16:40:28 +00:00
igor%mir2.org
65ceeaed9a 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.


git-svn-id: svn://10.0.0.236/trunk@157466 18797224-902f-48f8-a5cc-f745e15eee43
2004-06-06 15:33:59 +00:00
igor%mir2.org
a3818b0d89 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.
git-svn-id: svn://10.0.0.236/trunk@157048 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-28 14:19:11 +00:00
igor%mir2.org
77fe3c8f5a 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.
git-svn-id: svn://10.0.0.236/trunk@157012 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-27 11:26:59 +00:00
igor%mir2.org
37193b69ab exitAction is moved to DebugGui
git-svn-id: svn://10.0.0.236/trunk@157011 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-27 10:34:44 +00:00
igor%mir2.org
f37b8b637e Prepare to remove dependancy of core debugger implementation on GUI: introduction of GuiCallback interface that DebugGui implements.
git-svn-id: svn://10.0.0.236/trunk@157010 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-27 10:21:24 +00:00
igor%mir2.org
b4ca65a113 Work on 244492: JavaScriptException extends RuntimeException
git-svn-id: svn://10.0.0.236/trunk@156954 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-26 11:54:10 +00:00
igor%mir2.org
b68988b13d 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.


git-svn-id: svn://10.0.0.236/trunk@156803 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-23 16:15:09 +00:00
igor%mir2.org
178f646bc9 Make sure that for Rhino-generated exceptions Throwable.getMessage() contains script file and line information.
git-svn-id: svn://10.0.0.236/trunk@156802 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-23 14:32:07 +00:00
igor%mir2.org
7ace7bb478 Switch to line info extraction through single top script processing
git-svn-id: svn://10.0.0.236/trunk@156787 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-22 23:19:56 +00:00
igor%mir2.org
c5c90a5dba Splitting Main.java into Main.java and GUI-related DebugGui.java
git-svn-id: svn://10.0.0.236/trunk@156704 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 15:06:36 +00:00
igor%mir2.org
042d5c8fbc Split Main class into Main and DebugGui to have better debugger/gui separation
git-svn-id: svn://10.0.0.236/trunk@156703 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 14:25:21 +00:00
igor%mir2.org
ca388181aa Move all logic to open source window at the end of compilation to single update action.
git-svn-id: svn://10.0.0.236/trunk@156701 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 12:04:47 +00:00
igor%mir2.org
94ee98f884 Move logic to show exception dialog into EnterInterrupt action
git-svn-id: svn://10.0.0.236/trunk@156699 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 11:27:59 +00:00
igor%mir2.org
417c6e5046 Test file
git-svn-id: svn://10.0.0.236/trunk@156697 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 10:53:19 +00:00
igor%mir2.org
c5dcd0329f I changed StackFrame.onLineChange to access breakFlag directly which allowed to remove global context hashtable
git-svn-id: svn://10.0.0.236/trunk@156685 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 01:20:48 +00:00
igor%mir2.org
9f24ddd420 Merge various GUI initializations during breakpoint hit into single action
git-svn-id: svn://10.0.0.236/trunk@156682 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 01:10:04 +00:00
igor%mir2.org
02c5145a8e Removal of manThread: breakFlag can do its job just fine
git-svn-id: svn://10.0.0.236/trunk@156676 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 00:17:45 +00:00
igor%mir2.org
8b94e067ca Replace Context switching during eval for interrupted threads by thread communication so all evals happens on the original thread.
git-svn-id: svn://10.0.0.236/trunk@156675 18797224-902f-48f8-a5cc-f745e15eee43
2004-05-21 00:11:24 +00:00
igor%mir2.org
9c3223532f 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.
git-svn-id: svn://10.0.0.236/trunk@154087 18797224-902f-48f8-a5cc-f745e15eee43
2004-03-18 13:37:29 +00:00
igor%mir2.org
67138be31e 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.


git-svn-id: svn://10.0.0.236/trunk@151463 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-17 21:02:32 +00:00
igor%mir2.org
90bfcf47f9 Patch from Alex Bitney to fix bug 230883
git-svn-id: svn://10.0.0.236/trunk@151377 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-15 20:10:54 +00:00
igor%mir2.org
e46193a559 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.


git-svn-id: svn://10.0.0.236/trunk@150735 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-25 22:37:57 +00:00
igor%mir2.org
c85150a93c 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.
git-svn-id: svn://10.0.0.236/trunk@149190 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-12 12:22:12 +00:00
igor%mir2.org
3226e12c0a 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.


git-svn-id: svn://10.0.0.236/trunk@149161 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-11 20:30:08 +00:00
igor%mir2.org
22cd70c941 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.
git-svn-id: svn://10.0.0.236/trunk@149092 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-10 02:18:11 +00:00
igor%mir2.org
0f204cac48 Changes in Security API: using CodeBlock interface instead of reusing Script to represent code that should be executed with different domain.
git-svn-id: svn://10.0.0.236/trunk@149021 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-07 22:29:59 +00:00
igor%mir2.org
48d483ff35 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.
git-svn-id: svn://10.0.0.236/trunk@148689 18797224-902f-48f8-a5cc-f745e15eee43
2003-11-01 15:34:23 +00:00
igor%mir2.org
b60677fa53 Introduction of org.mozilla.javascript.Kit to contain generic support utilities.
git-svn-id: svn://10.0.0.236/trunk@148203 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-21 13:43:22 +00:00
igor%mir2.org
d813acd7f7 Added readUrl method to shell
git-svn-id: svn://10.0.0.236/trunk@148196 18797224-902f-48f8-a5cc-f745e15eee43
2003-10-21 09:13:59 +00:00
igor%mir2.org
b9e7e04541 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.
git-svn-id: svn://10.0.0.236/trunk@146810 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-12 17:12:20 +00:00
igor%mir2.org
da1b14c2e3 Siplified code to extract error message from Throwable to reflect recent changes in exception-related API semantics.
git-svn-id: svn://10.0.0.236/trunk@146768 18797224-902f-48f8-a5cc-f745e15eee43
2003-09-11 15:41:06 +00:00
igor%mir2.org
916d20bdd2 Adding readFile function to the shell to read file context.
git-svn-id: svn://10.0.0.236/trunk@145862 18797224-902f-48f8-a5cc-f745e15eee43
2003-08-11 10:54:40 +00:00
igor%mir2.org
146f273dbe 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
git-svn-id: svn://10.0.0.236/trunk@145650 18797224-902f-48f8-a5cc-f745e15eee43
2003-08-06 07:47:58 +00:00
igor%mir2.org
1143cfe592 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.


git-svn-id: svn://10.0.0.236/trunk@144504 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-06 19:21:42 +00:00
igor%mir2.org
e8b375fdbd Updating exception debugging to reflect changes due to http://bugzilla.mozilla.org/show_bug.cgi?id=210605 .
git-svn-id: svn://10.0.0.236/trunk@144385 18797224-902f-48f8-a5cc-f745e15eee43
2003-07-02 16:37:29 +00:00
igor%mir2.org
3eabc369dd Addition of seal function to Rhino shell to seal all supplied arguments.
git-svn-id: svn://10.0.0.236/trunk@142611 18797224-902f-48f8-a5cc-f745e15eee43
2003-05-19 15:53:23 +00:00
igor%mir2.org
8ad14f93fd 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.


git-svn-id: svn://10.0.0.236/trunk@142545 18797224-902f-48f8-a5cc-f745e15eee43
2003-05-16 14:25:57 +00:00