2963 Commits

Author SHA1 Message Date
nboyd%atg.com
7a819a25a9 Expand tutorial.
git-svn-id: svn://10.0.0.236/trunk@84956 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-16 15:24:23 +00:00
nboyd%atg.com
1fe9e1c3e0 Fix 64788 Make method invocation 10x faster with following code....
git-svn-id: svn://10.0.0.236/trunk@84934 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-14 01:19:58 +00:00
beard%netscape.com
7a1463e602 Keeping up with current Rhino sources. Removed Frame.java, Added DebugFrame.java, DebuggableEngineImpl.java.
git-svn-id: svn://10.0.0.236/trunk@84886 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-12 20:42:17 +00:00
beard%netscape.com
160323e9fa fixed no-prototype function warning.
git-svn-id: svn://10.0.0.236/trunk@84885 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-12 20:32:19 +00:00
nboyd%atg.com
1a08e287f2 Update comment; operator is part of ECMA.
git-svn-id: svn://10.0.0.236/trunk@84863 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-12 16:30:04 +00:00
nboyd%atg.com
1b2c7fe210 Add removeThreadLocal method.
git-svn-id: svn://10.0.0.236/trunk@84862 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-12 16:29:26 +00:00
nboyd%atg.com
60daf49df2 Fix infinite loop in example.
git-svn-id: svn://10.0.0.236/trunk@84861 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-12 16:28:36 +00:00
waldemar%netscape.com
a69eb6e11a Separated statements into statements, diretives, and definitions
git-svn-id: svn://10.0.0.236/trunk@84849 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-12 07:33:19 +00:00
brendan%mozilla.org
a7c505139b Fix ABW impurities under JS_ClearScope on an unmutated obj (64958, r=shaver, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@84825 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-11 23:55:30 +00:00
rogerl%netscape.com
09e69e2106 New (incomplete but functional) implementation of operator overriding.
git-svn-id: svn://10.0.0.236/trunk@84756 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-11 00:03:05 +00:00
waldemar%netscape.com
7d08b8aa83 Simplified use-name-patterns
git-svn-id: svn://10.0.0.236/trunk@84695 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-10 02:50:13 +00:00
nboyd%atg.com
5b49c69e7c 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


git-svn-id: svn://10.0.0.236/trunk@84649 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-09 14:10:40 +00:00
nboyd%atg.com
afc7358821 Missed checkin of new file.
git-svn-id: svn://10.0.0.236/trunk@84648 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-09 13:39:22 +00:00
nboyd%atg.com
0cc31dfbe2 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


git-svn-id: svn://10.0.0.236/trunk@84597 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-08 21:41:25 +00:00
nboyd%atg.com
df11745e20 Fix for 1.1 compatibility.
git-svn-id: svn://10.0.0.236/trunk@84567 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-08 14:34:21 +00:00
nboyd%atg.com
7575d629d7 Fix classloader problem from last checkin.
git-svn-id: svn://10.0.0.236/trunk@84545 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-08 02:13:28 +00:00
nboyd%atg.com
796b9043b4 Canonicalize file names to help debugger.
git-svn-id: svn://10.0.0.236/trunk@84544 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-08 02:12:52 +00:00
nboyd%atg.com
17df4648bd Latest changes from Chris Oliver.
git-svn-id: svn://10.0.0.236/trunk@84542 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-08 01:43:28 +00:00
nboyd%atg.com
e6a3f16701 Revert to old object identity for equality per ECMA.
git-svn-id: svn://10.0.0.236/trunk@84541 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-08 01:03:23 +00:00
nboyd%atg.com
1a570ec189 For == use .equals after unwrapping.
git-svn-id: svn://10.0.0.236/trunk@84430 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-05 20:00:47 +00:00
nboyd%atg.com
102caa5095 Fix bug 64397.
git-svn-id: svn://10.0.0.236/trunk@84427 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-05 19:15:59 +00:00
nboyd%atg.com
509540f585 Email thread describing change:
Subject:
             Re: Rhino bug - Wrapper ??
        Date:
             Fri, 05 Jan 2001 03:46:11 +0530
       From:
             Mukund Balasubramanian <mukund@cs.stanford.edu>
 Organization:
             Another Netscape Collabra Server User
 Newsgroups:
             netscape.public.mozilla.jseng
  References:
             1 , 2 , 3 , 4 , 5 , 6




That works too,
    Should I assume that this would be a part of the next tip ? I agree with the
part about
overloading code too.

    Anyways, thanks a load for your help and just tell me if I could be of any
help in any other
respects of the rhino project.

ThanX,

Mukund Balasubaramanian

Norris Boyd wrote:

> Actually, I was considering removing the unwrapping code from
NativeJavaConstructor. I was
> suprised that it was there. The code dates from before we implemented proper
method and
> constructor overloading in Rhino. It's the overloading code that should have
the responsibility
> for unwrapping.
>
> Does this patch work for you:
>
> Index: NativeJavaObject.java
> ===================================================================
> RCS file:
/cvsroot/mozilla/js/rhino/org/mozilla/javascript/NativeJavaObject.java
> ,v
> retrieving revision 1.29
> diff -u -r1.29 NativeJavaObject.java
> --- NativeJavaObject.java       2000/11/13 22:10:32     1.29
> +++ NativeJavaObject.java       2001/01/04 21:33:55
> @@ -673,6 +673,12 @@
>
>                  return Result;
>              }
> +            else if (value instanceof Wrapper) {
> +                value = ((Wrapper)value).unwrap();
> +                if (type.isInstance(value))
> +                    return value;
> +                reportConversionError(value, type);
> +            }
>              else {
>                  reportConversionError(value, type);
>              }
>
> This handles the case where the object is both a Scriptable and a Wrapper.
>
> --N
>
> Mukund Balasubramanian wrote:
>
> > Yes they do implement Scriptable.
> >     From my preliminary inspection of the code, findFunction seems to be
preceediong the
> > coerceType call and I presume findFunction call is going to fail if the
arguments are
> > wrapped (bad types mismatching signature).
> >     The constructor case DOES go through an explicit unwrapping stage as
shown by the cut
> > and paste code. My question is whether the same preamble in NativeJavaMethod
is a valid bug
> > fix.
> >
> > ThanX,
> >
> > Mukund Balasubramanian
> >
> > Norris Boyd wrote:
> >
> > > Do your objects that implement Wrapper also implement Scriptable? From
simple inspection
> > > of the code I'd think that both the constructor and method cases would go
through
> > > NativeJavaMethod.coerceType, which should unwrap. However, Scriptable
objects are picked
> > > off and handled before any unwrapping is considered.
> > >
> > > --N
> > >
> > > Mukund Balasubramanian wrote:
> > >
> > > > Yup,
> > > >     Here it is - Line numbers 173-178 are cut and paste from
> > > > NativeJavaConstructor.java inside NativeJavaMethod.java
> > > >
> > > > /*** Call in NativeJavaMethod.java
> > > >     public Object call(Context cx, Scriptable scope, Scriptable thisObj,
> > > >                        Object[] args)
> > > >         throws JavaScriptException
> > > >     {
> > > >         // Eliminate useless args[0] and unwrap if required
> > > >         for (int i = 0; i < args.length; i++) {
> > > >             if (args[i] instanceof Wrapper) {
> > > >                 args[i] = ((Wrapper)args[i]).unwrap();
> > > >             }
> > > >         }
> > > >
> > > >   // Find a method that matches the types given.
> > > >         if (methods.length == 0) {
> > > > ****/
> > > >
> > > > Is this correct ? I presume it is because of the fact that the
constructor
> > > > does this.
> > > >
> > > > Any luck with my other question regarding generalizing the WrapHandler
to all
> > > > objects (including those returned by scriptable) and not only those
returned
> > > > through nativeJava***
> > > >
> > > > ThanX,
> > > >
> > > > Mukund Balasubramanian
> > > >
> > > > Norris Boyd wrote:
> > > >
> > > > > Could you post your proposed patch?
> > > > >
> > > > > Thanks,
> > > > > Norris
> > > > >
> > > > > Mukund Balasubramanian wrote:
> > > > >
> > > > > > Hi all,
> > > > > >     I am trying to play around with writing a custom WrapHandler for
my
> > > > > > Java objects in Rhino. I found WrapHandler very useful.
> > > > > >     Now I am stuck at a point where, even though my wrappers
implement
> > > > > > "Wrapper", they get unwrapped only on calles to Constructors using
> > > > > > Liveconnect. Normal methods dont seem to be doing any unwrapping.
> > > > > > Managed to build rhino with a bug fix (cut and paste code from
> > > > > > NativeJavaConstructor to NativeJavamethod), and it works.
> > > > > >     Just wanted to verify if it is a known bug (while I wait for
> > > > > > bugzilla to mail me a passwd).
> > > > > >
> > > > > > BTW, also found something interesting, WrapHandler gets called only
when
> > > > > > the object is returned from NativeJava***, not ANY Object. Is that
the
> > > > > > way it is supposed to work ??
> > > > > >
> > > > > > ThanX for any help,
> > > > > >
> > > > > > Mukund Balasubramanian


git-svn-id: svn://10.0.0.236/trunk@84401 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-05 01:17:51 +00:00
brendan%mozilla.org
79aefcf7d3 Speed up js_qsort_r a bit (64065, r=mccabe, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@84368 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-04 10:13:18 +00:00
mccabe%netscape.com
73435597c1 Oops. Removing unneeded 'System.err.println("foo")'.
git-svn-id: svn://10.0.0.236/trunk@84318 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-04 00:03:00 +00:00
mccabe%netscape.com
2d59d1524e Fix to 64149.
Propagate lexer fixes from Monkey to accept (and warn) about 008 as well as just 08.


git-svn-id: svn://10.0.0.236/trunk@84311 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-03 23:36:33 +00:00
nboyd%atg.com
6aabad638c Get rid of BSF file in Rhino code. Just rely upon building BSF ourselves for now.
git-svn-id: svn://10.0.0.236/trunk@84302 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-03 20:54:37 +00:00
bryner%uiuc.edu
6f97e20f49 Removing dead .toc files. Not part of build. a=sfraser.
git-svn-id: svn://10.0.0.236/trunk@84289 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-03 01:32:06 +00:00
rogerl%netscape.com
0e8d6728f8 Fix for VC++ compile.
git-svn-id: svn://10.0.0.236/trunk@84269 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-02 19:49:16 +00:00
pschwartau%netscape.com
96cdacfd24 Correcting bug that cropped up when system clock was set to GMT Standard Time
git-svn-id: svn://10.0.0.236/trunk@84251 18797224-902f-48f8-a5cc-f745e15eee43
2001-01-01 02:40:28 +00:00
beard%netscape.com
15768bd995 another pass over LexUtils::cmp_nocase().
git-svn-id: svn://10.0.0.236/trunk@84227 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-30 08:08:12 +00:00
beard%netscape.com
6722eb9ce3 fix unsigned/signed comparison warnings
git-svn-id: svn://10.0.0.236/trunk@84226 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-30 07:55:01 +00:00
beard%netscape.com
d9996c96bc Use GC-safe vector of JSFunction* to hold getters/setters.
git-svn-id: svn://10.0.0.236/trunk@84225 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-30 07:46:18 +00:00
beard%netscape.com
8daa6ee2f4 no need to copy JSString values into String values.
git-svn-id: svn://10.0.0.236/trunk@84222 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-30 07:06:03 +00:00
rogerl%netscape.com
cc115b820f Fixed bit-rot in exception handling, removed unused locals.
git-svn-id: svn://10.0.0.236/trunk@84214 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-30 01:13:06 +00:00
rogerl%netscape.com
fd61a85fe9 re-ordered members wrt init sequence.
git-svn-id: svn://10.0.0.236/trunk@84213 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-30 01:08:31 +00:00
mccabe%netscape.com
61da61c5b4 Add emacs makefile modeline.
Not part of the Mozilla build.


git-svn-id: svn://10.0.0.236/trunk@84208 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-29 23:23:52 +00:00
rogerl%netscape.com
4e44ac8f21 Fix for #60164, more failure testing during exception processing.
r=mccabe, a=brendan


git-svn-id: svn://10.0.0.236/trunk@84202 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-29 22:19:09 +00:00
pschwartau%netscape.com
67cb793795 Initial add -
git-svn-id: svn://10.0.0.236/trunk@84171 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-29 02:46:32 +00:00
pschwartau%netscape.com
fd4c10b905 Adjusting hard-coded Pacific timezone date testcases to work in any tester's timezone -
git-svn-id: svn://10.0.0.236/trunk@84066 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-26 20:02:04 +00:00
pschwartau%netscape.com
e40507fc34 Adding functionality to adjust hard-coded date tests (written for Pacific timezone) for the tester's own timezone
git-svn-id: svn://10.0.0.236/trunk@84065 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-26 19:55:05 +00:00
pschwartau%netscape.com
a27f1315b0 Modifiying one line that was failing in GMT+ timezones (i.e. east of Greenwich)
git-svn-id: svn://10.0.0.236/trunk@84064 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-26 19:34:07 +00:00
waldemar%netscape.com
ae23dd6d5d Revamped the syntax for calling superconstructors and tightened up the syntax for the super operator
git-svn-id: svn://10.0.0.236/trunk@83976 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-22 02:02:14 +00:00
mccabe%netscape.com
3ca285bf65 Fix courtesy jband to quiet unused variable warning.
Move 'dlsoffset' to the block where it's used, inside #ifdef XP_MAC.

r=mccabe


git-svn-id: svn://10.0.0.236/trunk@83936 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-21 04:32:13 +00:00
waldemar%netscape.com
ffbb170b06 Simplified postfix-expressions and use-exclude-include
git-svn-id: svn://10.0.0.236/trunk@83921 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-21 00:04:52 +00:00
brendan%mozilla.org
1f9562bcf1 Don't fatten a flyweight lock unnecessarily in JS_SetPrototype; misc. cleanups (63097, r=mccabe, sr=jband).
git-svn-id: svn://10.0.0.236/trunk@83914 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-20 22:36:01 +00:00
nboyd%atg.com
7e1f1b1404 Nope, 8 was right.
git-svn-id: svn://10.0.0.236/trunk@83896 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-20 13:31:59 +00:00
waldemar%netscape.com
978e7614c6 Changed 'operator' from a keyword to an attribute.
git-svn-id: svn://10.0.0.236/trunk@83820 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-19 01:57:13 +00:00
waldemar%netscape.com
90c740d3cf Removed 'operator' non-reserved word
git-svn-id: svn://10.0.0.236/trunk@83819 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-19 01:56:36 +00:00
nboyd%atg.com
43cdd511cc Off by one error fixed.
git-svn-id: svn://10.0.0.236/trunk@83788 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-18 19:32:00 +00:00
nboyd%atg.com
5f3aed5cb5 Add ContextListener to API classes.
git-svn-id: svn://10.0.0.236/trunk@83787 18797224-902f-48f8-a5cc-f745e15eee43
2000-12-18 19:30:26 +00:00