Commit Graph

168 Commits

Author SHA1 Message Date
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
nboyd%atg.com
9f67dc975f Fix bug 202344. 2003-04-21 14:59:22 +00:00
igor%mir2.org
58a609ac23 Patch from Steven Beal fixing a bug due to my changes:
I just noticed that the changes introduced with
v1.29 of Main.java broke the ability to do hot
reloads of scripts.  To be more explicit, the script
is actually reloaded but the source in the debugger
is not updated to reflect the newly loaded code.
...
Attached is a patch that restores the original behavior.
The refactorings are preserved but the handling of
previously loaded SourceInfo objects is restored and the
check for previously loaded ScriptItem instances
removed.
2003-02-13 03:01:09 +00:00
igor%mir2.org
615d6d6623 Do not call setSelectedIndex on frame JList if there are no frames. 2003-01-26 18:33:30 +00:00
igor%mir2.org
ae4b000c3f Added documentation strings for runCommnad and spawn is changed to pass empty argument array instead of null if function arguments are not specified to avoid a null pointer exception in InterpretedFunction.call 2003-01-26 18:28:26 +00:00
igor%mir2.org
7b5c64a220 Added runCommand to execute external processes 2003-01-26 15:43:50 +00:00
igor%mir2.org
3b9a6fe0ef Patch from Christopher Oliver to fix http://bugzilla.mozilla.org/show_bug.cgi?id=189183 2003-01-20 15:09:45 +00:00
igor%mir2.org
d8492658bb Committing patch from Steven Beal:
Have you considered adding a "Go" method to Main.java with
public visibility (same behavior as pressing the "Go" button in the debugger UI).

This would be a big help in a system where the debugger has been
embedded.  Being able to close the debugger and ensure that any
breakpoints were removed and any blocked threads notified would
be a nice feature.  Without this, closing the debugger can either
a) halt the application or b) destroy the debugger leaving blocked
threads in a permanent wait state.  Note that the debugger is
not actually destroyed in this case because the waiting threads
prevent it from being wholly GCed.
2003-01-15 10:42:56 +00:00
igor%mir2.org
71741a82b8 Fixing mnemonics shortcuts for Debug menu 2003-01-14 14:44:46 +00:00
igor%mir2.org
b9e26a25cb From Steaven Beal:
This looks like a simple case of using the Hashtable key
instead of the value...

    public void clearAllBreakpoints() {
        // Igor - Use of keys() is inappropriate here.  It produces
        // a ClassCastException on the assignment below.  The
        // keys are String instances, not SourceInfo instances...
        //
        //Enumeration e = sourceNames.keys();
        Enumeration e = sourceNames.elements();
	...
    }
2003-01-14 11:24:47 +00:00
igor%mir2.org
b0dd32ca85 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. 2002-12-31 18:21:32 +00:00
igor%mir2.org
34427cc0a9 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.
2002-12-31 09:42:42 +00:00
igor%mir2.org
d90d743307 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.
2002-12-28 05:37:43 +00:00
igor%mir2.org
ec811806ab Cosmetics: expanding tabs 2002-12-17 20:56:08 +00:00
igor%mir2.org
b99f98d8e9 Cosmetics: removal of junk white-space at line end 2002-12-17 20:48:35 +00:00
igor%mir2.org
8ae4899263 Fixing http://bugzilla.mozilla.org/show_bug.cgi?id=184111
Patch from Marcus Crafter:
...
After speaking with Christopher Oliver, the problem seems to be a general JDK
1.4 bug that caches selected values in JComboBox, even after removeAllItems() is
called. Since its a general defect Christopher and I thought we'd report and get
it fixed in the main CVS tree.
...
2002-12-08 21:06:45 +00:00
igor%mir2.org
50029c37e2 If debugger does not get function or script source via handleCompilationDone, try to read it from supplied URL. 2002-12-08 20:49:39 +00:00
igor%mir2.org
9be5d10e5c Replace getScriptable() by getFunctionName() in omj/debug/DebuggableScript.java as the debugger used DebuggableScript.getScriptable() only to query function names.
It allows to implement the DebuggableScript interface only  by omj/InterpreterData instead of 2 identical implementations by InterpretedFunction and InterpretedScript.
2002-11-14 21:12:36 +00:00
igor%mir2.org
efd9f298ab Call NativeArray.getLength() instead of deprecated NativeArray.jsGet_length() 2002-11-12 09:41:09 +00:00
igor%mir2.org
7ad5c25d66 Fixing ArrayIndexOutOfBoundsException reported by Steven Beal caused by broken code to setup endLine in SourceInfo.updateLineInfo. 2002-08-15 06:42:45 +00:00
igor%mir2.org
988587183a New security implementation. 2002-07-04 21:40:12 +00:00
igor%mir2.org
77af40f3ba From the email:
The attached patch adds support for debugging eval and Function code transparently. It changes omj.NativeGlobal and omj.BaseFunction to embed  line number of origin of eval and Function scripts into source name and pass 1 as base line for script code. In this way a debugger implementation can treat eval and Function code in the same way as scripts loaded from some url while giving more information about error location in case of an error in eval code as the error source would contain both line number of eval origin and line number in eval code itself.
I chose to embed line numbers via patterns like

sourcefile#<line-number>(eval)
sourcefile#<line-number>(Function)

just to be able to to pass the constructed name to URL constructor if the original sourcefile is a valid URL but it is pretty arbitrary.
2002-05-20 11:40:17 +00:00
igor%mir2.org
4bb3f8ada0 Elimination of FileWindow.breakpoints and Main.breakpointsMap as reference to SourceInfo provides all necessary information 2002-05-11 18:28:44 +00:00
igor%mir2.org
ba0661c493 Removing itsFirstLine and itsEndLine from InterpreterData and replacing in DebuggableScript getFirstLine, getEndLine and getIntructionLines by getLineNumbers as Debugger imlementation can get all the necessary information from single call to getLineNumbers 2002-05-11 16:15:50 +00:00
igor%mir2.org
6d860f39e3 From email about moving breakpoint support away from Rhino core:
I attach the patch to move away setting/quering for breakpoints from the Rhino core to application as a debugger implementation can check if a particular line has a breakpoint or not. The changes to omj/tools/debugger takes more then few lines I initially thought but they are mostly caused by refactoring to implement different view to set/query breakpoints.

The patch replaces getLineNumbers, placeBreakpoint and removeBreakpoint in DebuggableScript by getFirstLine, getEndLine and getInstructionLines where the last function fills a boolean array to indicate which script lines can ever occur in DebugFrame.onLineChange. These are read-only functions so InterpeterData are never mdofied by the debugger.

omj/tools/debugger/Main uses this information to check whether it is possible to place breakpoint at a particular line, and if possible, it sets to true entry at the boolean breakpoint array. In this way testing for break in onLineChange is simple and fast as it just needs to check if breakpoint array holds true at the given line number position.
2002-05-10 16:17:33 +00:00
igor%mir2.org
aa545a86e2 Replace when possible usage of API available only since JDK 1.2 by their JDK 1.1 analogous or by classes available in the Rhino core to make port to JDK 1.1 easier. 2002-05-03 19:42:36 +00:00
igor%mir2.org
fe448dc961 Updating the debugger to reflect changes in Rhino debug API. 2002-04-22 20:47:51 +00:00
igor%mir2.org
760e4b4196 Clear jiles warning:
VariableModel.java:220:30:220:40: Caution: This try block cannot throw a "checked exception" (JLS section 14.7) that can be caught here. You may have intended to catch a RuntimeException instead of an Exception.
2002-04-06 17:33:33 +00:00
igor%mir2.org
c31e40fc89 From the email about debug API changes:
Changes to omj.tools.debugger are mostly due to renames and refactoring, the new code is limited to ContextData class which contains simplified version of the code for DebugFrame stack from the current DebuggableEngineImplementation and FrameHelper class implementing DebugFrame.
2002-04-06 13:57:24 +00:00
nboyd%atg.com
750bfdb52c Patch from Chris Oliver:
Hi Norris,

Can you check in the attached Main.java which works around a problem with using
JTreeTable in JDK 1.4.

Thanks,

Chris
2002-04-01 22:12:11 +00:00
nboyd%atg.com
b9766e8169 Changes from Christopher Oliver:
Hi Norris,

Would you mind checking in the attached changes to the debugger. The
attached files include the following changes:

1) Use ScriptableObject.getAllIds to obtain an object's properties (if
the object extends ScriptableObject).  This makes non-enumerable
properties visible in the debugger for ScriptableObject's.
2) Made the coding style more consistent with the rest of Rhino.
3) Better support for displaying and stepping through eval-ed code.

As Igor suggested to me once, it might be a good idea to define a new
interface to similarly support debugging host objects that don't extend
ScriptableObject, something like the following:

public interface Debuggable extends Scriptable {
    public Object[] getAllIds();
}

The debugger could check for this interface and if a host object chose
to implement it, the debugger would be able to display its
non-enumerable properties.

Chris
2002-03-26 23:02:43 +00:00
nboyd%atg.com
4b432d7521 Add missing support for multiple -implements classes 2002-03-24 22:37:57 +00:00
timeless%mac.com
dec943eb10 Bug 106386 rid source of misspellings
r=db48x sr=blake a=asa
2002-03-19 04:30:17 +00:00
igor%mir2.org
d262e89e9f Added .cvsignore to ignore generated sources 2002-03-16 23:34:23 +00:00
igor%mir2.org
b20f228b29 cosmetics: end-of-line whitespace removal 2002-02-11 01:33:23 +00:00
igor%mir2.org
142bcdb900 tabs -> spaces 2002-02-11 00:02:14 +00:00
nboyd%atg.com
d7f0af7c79 Have ClassNameHelper object be allocated lazily 2002-02-05 13:47:16 +00:00
nboyd%atg.com
eec81fb952 Fix bug 121790 2002-01-26 19:15:06 +00:00
nboyd%atg.com
cf94c28b89 Fix formatting 2002-01-26 19:13:22 +00:00
nboyd%atg.com
c24a699dd8 Fix the following problem:
Thanks!

As promised, I tried the debugger this afternoon and I had a problem with the '-f' option.
  We use -f to run a standard "startup" script before executing the "main" script.  For
example, we run the Rhino shell with the options "-f startup.js main.js".

When running the debugger's shell with the same options the debugger exits after the
startup.js completes; i.e., I can single step starting from startup.js but the debugger
exits at the end of startup.js without letting me single step into main.js.  This worked
fine in the 1.5R2 release of Rhino and the debugger.

I have not had a chance to look into the problem closely, but a cursory look at the code
suggests (to me) that the problem can be in either the debugger or the shell (since the
debugger basically runs the shell after creating the right "hooks".)  Of course, it could
also be a problem with my embedding.

So ... my question is, has anyone tried single stepping when the options to the debugger
include a '-f' option.  If so, I'll continue to look for a problem in my embedding.

Any suggestions would be appreciated.

Thanks,

dave
2002-01-24 19:57:01 +00:00
nboyd%atg.com
15ce244c1d Print implementation version when starting up interactive mode. 2002-01-04 14:02:02 +00:00
igor%mir2.org
30dfb0a96f Use Vector.elementAt instead of Vector.getfor jdk 1.1 complience 2001-12-20 22:05:42 +00:00
igor%mir2.org
d6078a18da Fixes to allow to use jikes to compile and produce less warnings:
1. Replace catch(Exception) by catch(RuntimeException) when only RuntimeException can be throws

2. Make sure that inner classes does not use the same name for parameters as parent scope, see  http://domino.watson.ibm.com/syssftpr/JavaTech/Jikes.nsf/Named/SunQuery8
2001-12-20 21:15:02 +00:00
nboyd%atg.com
82fd57b5aa Hello !
I'm the maintainer of JPackage project rhino package (see
jpackage.sourceforge.net). I just found two problems for building it (version
1.52 from cvs):
- the property src.debugger is badly initialised in toolsrc/build.xml. See
patch attached for correction. Moreover, this was a real pain to make offline
building possible. I guess it's a licensing problem that prevents you
including those files in rhino sources ?
- the produced javadoc has an empty (0 sized) package-list file. Have you got
any idea why ?
-- Guillaume Rousse <rousse@ccr.jussieu.fr>
GPG key http://lis.snv.jussieu.fr/~rousse/gpgkey.html
2001-12-06 14:26:26 +00:00
nboyd%atg.com
bcf8c2b632 Move serialization classes to separate package. 2001-09-29 20:54:08 +00:00
nboyd%atg.com
212d1b132a Add support for serialization and deserialization. 2001-09-27 02:33:51 +00:00
nboyd%atg.com
a14d6d33c5 patch (with my modifications) from jj@mail.ahc.umn.edu:
It would be nice if the rhino shell would accept a URL as the source
for javascript.

I've added this feature to my local copy so that I can launch rhino
with js scripts using  JavaWebStart.

Below is a context diff of the changes I made to
toolsrc/org/mozilla/javascript/tools/shell/Main.java
2001-09-06 16:53:29 +00:00
nboyd%atg.com
bf90b94ec7 Subject:
Re: Rhino 1.5R2 release candidate
        Date:
             Fri, 13 Jul 2001 22:52:43 -0700
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             Norris Boyd <nboyd@atg.com>
  References:
             1




Hi Norris,

Attached are some (final?) changes to the debugger:

- Display NativeCall objects as "[object Call]" in this/locals tree-tables
- Fixed "Go to Function" to highlight the target function in the source
window
- Synchronized ContextListener implementation
- Added slightly more useful tooltips to the tool bar

Note I modified files from today's rhinoTip.zip.  Hopefully they were
identical to those in the cvs release branch.

Chris
2001-07-14 17:17:35 +00:00
nboyd%atg.com
bd4398308e Subject:
Rhino: deal with all Throwables in Interpreter.interpret
        Date:
             Thu, 12 Jul 2001 14:27:34 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




The attached patch modifies the catch code in Interpreter.interpret to
catch general Throwable exceptions to allow cleanup after throwing an
Error instance from Context.observeInstructionCount.
===================
Subject:
             Rhino: change of InterpreterData.itsLineNumberTable from Hahstable to
             UintHash
        Date:
             Thu, 12 Jul 2001 15:51:38 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




The patch linetable_patch changes InterpreterData.itsLineNumberTable
from Hahstable to UintHash and debug/DebuggableScript.java to return
int[] array instead of Enumeration. It was run produced via
diff -ru javascript.0 javascript

The patch debugger_patch contains update for
toolsrc/org/mozilla/javascript/tools/debugger/Main.java to reflect above
api changes.
===============================
Subject:
             Rhino: patch not to store VariableTable in InterpreterData
        Date:
             Thu, 12 Jul 2001 16:34:18 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




The patch removes the "VariableTable itsVariableTable" field from
InterpreterData so it would not be stored in
InterpretedFunction/InterpretedScript and could be garbage collected
after interpreter byte code generation is finished. The usage of
theData.itsVariableTable it Interpreter.interpret is replaced by
accessing argNames/argCount fields from the passed NativeFunction.
2001-07-13 13:53:40 +00:00
nboyd%atg.com
b7d911651e Subject:
Bugfix to Rhino Debugger
        Date:
             Sat, 30 Jun 2001 06:09:44 -0700
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             nboyd@atg.com




Hi Norris,

Attached is a fix to a problem I encountered with the Rhino debugger.
Apparently some recent changes to the engine broke the debugger because
the debugger wasn't  acquiring a Context before making certain engine
calls like ScriptableObject.getIds().  You can see this by stepping
through the "enum.js" example and expanding the variable "elements".
The below exception trace will be printed on the debugger console.  The
attached file should fix this problem.

Chris

Subject:
             Another fix to VariableModel.java
        Date:
             Sat, 30 Jun 2001 07:33:51 -0700
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             nboyd@atg.com




Hi Norris,

I modified this file to always call Context.toString() to display a
variable's value in the the tree table.  Previously it only called it
for Scriptables and the toString() method of the object otherwise.  This
caused for example JavaScript "2" to be displayed as "2.0".

Chris
2001-07-02 13:55:20 +00:00
nboyd%atg.com
a3ebe88fb9 Subject:
Rhino: speed optimization in omj/Interpreter.java
        Date:
             Tue, 26 Jun 2001 21:06:56 +0200
       From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




Hi, Norris!

The attached Interpreter_patch contains a speed optimization patch that
tries to avoid creation of Double objects by keeping a parallel stack
for double values: instead of putting Double to the stack, DBL_MRK is
put and the real value is put to double stack (sDbl). Then when reading
stack with DBL_MRK, the double value from the double stack is used
wrapped to Double object when necessary. In addition local and vars
arrays are merged to stack array.

The attached before.txt and after.txt contain results of typical runs of
mozilla/js/benchmarks/all_bench.js before and after optimization on my
PC: Athlon 650/Red Hat 7.0/JDK 1.3.0 from Sun .

In number of cases the optimization actually slow down the executionby
5-10% (I guess due to the checks for DBL_MRK), but mostly it is a nice
sped up often by factor of 2 ot more with overall optimization win: 267
versus 218 seconds.

I guess it is possible to apply the same optimization to the optimizer
package, but in our browser we use strictly interpreter mode. Also by
changing signature of call/construct methods in Scriptable it is
possible to avoid creation of almost all objects currently allocated
during method calls, but that is for far future.

Regards, Igor
2001-06-28 14:28:19 +00:00
nboyd%atg.com
8214f675ca The patch applies the following optimization to TokenStream:
1. Keyword search via Java Hahstable is replaced by explicit "switch"
code generated by idswitch tool. It not only speed up keyword search and
eliminates all Integer objects created to hold keyword tokens and
corresponding Hahstable structures, but it also reduces code size due to
very poor array initialization support in JVM.

2. It replaces the isXDigit method by xDigitToInt that either converts
its argument to 0..15 or returns -1 if it is not a hex digit and updates
the method usage accordingly The patch updates NativeGlobal.js_unescape
to reflect this usage change.
2001-06-04 13:59:30 +00:00
nboyd%atg.com
d589083a1e Patches from Igor:
-----
The patch changes NativeCall to use IdScriptable. This is done mostly
for uniformity with other Native* classes plus it would allow to call
NativeCall.init directly and make NativeCall package private.
-----
The patch changes NativeScript to use id-based properties. Due to
inheritance from NativeFunction, id support requires to take into
account the fact that there are instance ids available from
BaseFunction. This is the reason to use "int prototypeIdShift" instead
of "boolean prototypeFlag" so it can store instance id offset.

The patch updates ScriptRuntime.callOrNewSpecial to check against
IdFunction and not FunctionObject for the Script exec method where it
also add finally clause to make sure that Context.exit would always be
called after Context.enter in the evalScript method.
-----
After converting NativeScript and NativeFunction to use IdScriptable,
they get scope argument directly as a parameter of execMethod call, so
cx.ctorScope is not used any more. The patch removes code to set/unset
cx.ctorScope.
-----
[This patch depends on conversion of NativeScript and NativeCall to use
IdScriptable and the patch to remove access of ctorScope from
FunctionObject]

The patch changes Context.initStandardObjects to call NativeCall.init
and NativeScript.init directly plus it unrolls the lazily initialization
loop. Due to rather poor support of an array initialization in Java byte
code, it actually decreases code size while eliminating are creation of
array object. The patch also removes ctorScope field as unused.
-----
The patch makes sure that ids used by NativeGlobal are visible only in
the object instance that initializes global scope and removes some junk
white space at line ends.
-----
To use the idswitch tool to generate map for strings that can not be
part of Id_ Java identifier like $*, I added code to the tool to look
for "// #string=...#" in the id definition line. The attached README
file also contains some documentation about the tool and should go to
idswitch directory.

The patch was made from toolsrc/org/mozilla/javascript/tools via:
cvs diff -u > idswitch_patch
2001-05-25 13:24:17 +00:00
nboyd%atg.com
2c7ba42b18 Add idswitch package. 2001-05-09 17:12:07 +00:00
nboyd%atg.com
66b3d8aae3 Change use of deprecated method. 2001-05-08 13:51:18 +00:00
nboyd%atg.com
991a880e56 Commit missing messages for new idswitch tool. 2001-05-08 13:42:56 +00:00
nboyd%atg.com
3d11fc509c Make the debugger's main class be Main.java to match convention. 2001-05-04 15:22:10 +00:00
beard%netscape.com
ad25062b57 Restore revision history. 2001-04-27 19:37:39 +00:00
nboyd%atg.com
1944203c68 Move files to rhino/toolsrc 2001-04-24 20:42:14 +00:00
nboyd%atg.com
711c087f8e Massive reconfiguration of the cvs directory structure:
mozilla/js/rhino/org is now distributed between
mozilla/js/rhino/src and mozilla/js/rhino/toolsrc.
The build.xml has been split in three.
Docs now live in the project directory.

These changes mean that the cvs directories mirror the distribution and thus a distribution
will build the same way as a cvs build.
2001-04-24 20:31:31 +00:00
nboyd%atg.com
64bdadc1e0 Add Igor's changes to make generation of id strings by tool. 2001-04-10 13:20:02 +00:00
nboyd%atg.com
a867dbf67d Subject:
Minor fix to JSDebugger
        Date:
             Wed, 28 Mar 2001 16:34:24 -0800
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             nboyd@atg.com




Hi Norris,

Attached is a minor fix to the JSDebugger GUI that causes the tool-bar buttons to all have the same width.
I checked out and modified a file from CVS today.  See the screenshot below.

Cheers,

Chris
2001-03-29 01:44:45 +00:00
matthias%sorted.org
8d348ad77e * made shell.Global a subclass of ImporterTopLevel
* fixed ImporterTopLevel constructor - it now calls
cx.initStandardObjects before defining any functions. The old
constructor is still around for backwards compatibility.
2001-03-05 08:46:10 +00:00
matthias%sorted.org
6413b694ba getInstance now uses ScriptableObject.getProperty instead of
Scriptable.get. This way Global can (again) be used in prototype
chain.
2001-03-01 13:33:55 +00:00
matthias%sorted.org
f39acf5399 introduced "sync" helper function for converting a Javascript function
into a Java-style synchronized method
2001-01-31 13:05:21 +00:00
nboyd%atg.com
b8ac59c406 Subject:
Re: Debugger problem
        Date:
             Mon, 08 Jan 2001 14:16:30 -0800
       From:
             Christopher Oliver <coliver@mminternet.com>
 Organization:
             Primary Interface LLC
         To:
             Kurt Westerfeld <kurt@ManagedObjects.com>
         CC:
             Norris Boyd <nboyd@atg.com>
  References:
             1 , 2 , 3




Kurt, Norris,

Yes, with the change to the shell this should be possible.  The problem before
was that if you loaded the same file with different relative path names, two
different windows in the debugger were created because everything (windows,
breakpoints, etc) is keyed off the source name.

The attached file contains the fix (and includes the workaround for
Desktop.getSelectedFrame).

There are still some bugs in transferring focus between the windows in the
Desktop.  I haven't had time to track down the problem or a solution.

Chris

Kurt Westerfeld wrote:

> I would point out that "Source Name" of a script isn't necessarily a
> filename.  In our system, scripts are run remotely from a script library
> that has no file system backing.  Canonicalizing the file names is really
> unnecessary.
>
> Can't you just modify JSDebugger to not care what the name of the file is?
> If access to the original script is unavailable except through the file
> system, I'd be surprised.
>
> ----- Original Message -----
> From: Christopher Oliver <coliver@mminternet.com>
> To: Kurt Westerfeld <kurt@ManagedObjects.com>
> Cc: Norris Boyd <nboyd@atg.com>
> Sent: Sunday, January 07, 2001 2:23 AM
> Subject: Re: Debugger problem
>
> > Hi Kurt,
> >
> > I rather would say that it is a problem with the processFile method in the
> > shell's Main class.  If you change the current working directory or the
> value
> > of the System property "user.dir" after compiling a script, relative path
> names
> > can become ambiguous.  Norris, would it be ok to modify the shell to
> > "canonicalize" the names of files it compiles?  That way the source name
> that
> > shows up in the stack and in DebuggableScript will always be unique.  For
> > example:
> >
> > public static void processFile(Context cx, Scriptable scope,
> >                                    String filename)
> >     {
> >             Reader in = null;
> >             try {
> >                 in = new PushbackReader(new FileReader(filename));
> >                 int c = in.read();
> >                 // Support the executable script #! syntax:  If
> >                 // the first line begins with a '#', treat the whole
> >                 // line as a comment.
> >                 if (c == '#') {
> >                     while ((c = in.read()) != -1) {
> >                         if (c == '\n' || c == '\r')
> >                             break;
> >                     }
> >                     ((PushbackReader) in).unread(c);
> >                 } else {
> >                     // No '#' line, just reopen the file and forget it
> >                     // ever happened.  OPT closing and reopening
> >                     // undoubtedly carries some cost.  Is this faster
> >                     // or slower than leaving the PushbackReader
> >                     // around?
> >                     in.close();
> >                     in = new FileReader(filename);
> >                 }
> >                 filename = new java.io.File(filename).getCanonicalPath();
> > <<<====== Add this
> >             }
> >             catch (FileNotFoundException ex) {
> >                 Context.reportError(ToolErrorReporter.getMessage(
> >                     "msg.couldnt.open",
> >                     filename));
> >                 exitCode = EXITCODE_FILE_NOT_FOUND;
> >                 return;
> >             } catch (IOException ioe) {
> >                 globalState.getErr().println(ioe.toString());
> >             }
> >
> >             // Here we evalute the entire contents of the file as
> >             // a script. Text is printed only if the print() function
> >             // is called.
> >             evaluateReader(cx, scope, in, filename, 1);
> >     }
> >
> >
> > Attached is *my* latest version of the debugger code.  Norris, have you
> made
> > any progress on cvs commit priveledges?  The attached version fixes a
> number of
> > GUI bugs:
> >
> > 1) If you undocked the Variables window and popped up the Context
> combo-box and
> > then closed the window with the system menu, the Context pop-up was not
> cleaned
> > up properly.
> > 2) The first time you minimize a file window it appeared to dissappear
> when you
> > tried to restore it.  This was due to the fact that I forgot to "pack" its
> > contents and as a result its requested size was 0x0.
> >
> > I also added a menu item to toggle whether to break on exceptions and one
> which
> > allows you to open (and compile) a JavaScript file without actually
> executing
> > it.
> >
> > I have also attached a Word document with some basic documentation for the
> > Debugger.
> >
> > Note that this version also includes all the changes to support debugging
> > scripts in the AWT dispatch thread.
> >
> > Chris
> >
> > Kurt Westerfeld wrote:
> >
> > > Hello.  I ran into a null pointer exception in JSDebugger tonight, and I
> > > thought I'd drop you a note.
> > >
> > > The problem line is 2336, where a breakpoint is hit.  To simulate, load
> the
> > > debugger using the command line syntax on a file that has not been
> resolved
> > > to cannonical path.
> > >
> > > Example,
> > >
> > >      jshell -debug -f \myfile.fs
> > >
> > > At any rate, the "handleCompilationDone" routine takes \myfile.fs and
> turns
> > > it into a canonical path.  If you hit a breakpoint in this file and say
> > > "go", when the breakpoint hits the file is not found, because the same
> > > canonical path resolution is not done.  The resolution seems dubious,
> since
> > > it is only done in the compilation done callback, but I don't know the
> best
> > > way to suggest a fix since it seems that code had some purpose.
> > >
> > > Anyway, thought you'd wanna know.
> > >
> > > ________________________________________________________________________
> > >   Kurt Westerfeld
> > >   Senior Software Architect
> > >   Managed Objects
> > >   mailto:kwester@ManagedObjects.com
> > >   703.770.7225
> > >   http://www.ManagedObjects.com
> > >
> > >   Managed Objects: manage technology > rule business
> >



   JSDebugger.java

                    Name:
                          JSDebugger.java
                    Type:
                          Java Class File (java/*)
                 Encoding:
                          base64
2001-01-09 14:10:40 +00:00
nboyd%atg.com
cbf2c6d0b4 Clean up debug APIs.
* Make use of DebuggableEngine interface to keep Context API smaller
* Change org.mozilla.javascript.debug.Frame to DebugFrame to avoid
  confusion with java.awt.Frame
2001-01-08 21:41:25 +00:00
nboyd%atg.com
05afc92b5d Fix for 1.1 compatibility. 2001-01-08 14:34:21 +00:00
nboyd%atg.com
1de208b764 Canonicalize file names to help debugger. 2001-01-08 02:12:52 +00:00
nboyd%atg.com
59adb03eb5 Latest changes from Chris Oliver. 2001-01-08 01:43:28 +00:00
nboyd%atg.com
5e0b2ebaed Fix 62559, 58479 2000-12-12 14:35:38 +00:00
beard%netscape.com
a6859a2ef4 Keep JDK 1.1 compatible. 2000-11-27 23:40:15 +00:00
nboyd%atg.com
0c1b050f8c Add debugger contribution from Christopher Oliver. 2000-11-27 15:00:45 +00:00
beard%netscape.com
07a119a7ed removed import of non-existent org.mozilla.javascript.tools.debugger.* package. 2000-11-23 04:24:34 +00:00
nboyd%atg.com
e2c5be11b5 * Add ContextListener interface
* Add ability to access shell functions from compiled scripts, and to
  add shell functions to embedded apps more easily
2000-11-22 15:00:05 +00:00
nboyd%atg.com
571a5c5624 Fix 60184, and add SwingApplication.js example, with change
to shell to prevent early exit.
2000-11-17 13:05:46 +00:00
nboyd%atg.com
006574d547 Subject:
updated Global, Main and ImporterTopLevel
   Date:
        Mon, 23 Oct 2000 14:37:45 +0100
   From:
        Matthias Radestock <matthias@lshift.net>
     To:
        nboyd@atg.com




Norris,

I've made some more changes to shell.Main and shell.Global in order to
reduce their mutual dependency, enable "quit" and get "load" to operate
in the local scope.

see attachments for updated .diffs.


Matthias.
2000-10-23 15:55:42 +00:00
nboyd%atg.com
9a21820390 Merge changes from EXP_DEBUGGER branch into tip.
Implements simple command-line debugger for scripts.
2000-08-15 15:54:46 +00:00
nboyd%atg.com
c65fc2d8fd Fix 47859 2000-08-09 20:22:37 +00:00
nboyd%atg.com
4d4458bd63 Add column number and line source information to the EcmaError object. 2000-06-01 17:30:28 +00:00
norris%netscape.com
cd8ce490e8 Fixes for NervousText example. 2000-03-09 21:50:14 +00:00
norris%netscape.com
140fe5ab49 Clean up debugging interfaces. 2000-03-03 21:46:44 +00:00
norris%netscape.com
6d54dce0ca Avoid static never-released reference to streams; causes problems for Patrick Beard's use of the shell. 2000-02-15 17:08:31 +00:00
norris%netscape.com
da933ad300 Propagate changes from 1.5 branch. 2000-01-26 18:57:00 +00:00
norris%netscape.com
913e66ba3c Propagate fix from branch. 2000-01-06 16:28:43 +00:00
norris%netscape.com
403430a7d3 EvaluatorExceptions should set an exit error code. 1999-12-02 19:12:34 +00:00
norris%netscape.com
504a2557ce Fix test failures:
ecma_2/Exceptions/expression-020.js
js1_4/Regress/date-001-n.js
js1_4/Regress/toString-001-n.js
1999-11-22 23:48:06 +00:00
rginda%netscape.com
57279e1a51 * Global.java
Cleared global.exitCode in quit() just to be safe.
* Main.java
  Adjusted exit code constants to match the js and xpcshells.
1999-11-17 20:26:17 +00:00
norris%netscape.com
b15e2970b0 Make -f semantics match those of the C engine. 1999-11-17 00:04:17 +00:00
norris%netscape.com
9e1cbbe40a Add contributor. 1999-11-16 23:58:11 +00:00
norris%netscape.com
a79f73f658 rginda's changes for having quit() take an exit code. 1999-11-16 23:57:23 +00:00
norris%netscape.com
5d10d91ea2 Unify evaluation code to improve consistency and improve code size. 1999-11-05 22:18:24 +00:00
norris%netscape.com
4ad45bf1ec Remove JSuncaughtExceptionLine, use an error reporter to report line number info instead. 1999-11-05 21:48:05 +00:00
norris%netscape.com
f0b53fc5a9 Fix spelling of contributor's name. 1999-10-28 17:43:43 +00:00