Граф коммитов

3229 Коммитов

Автор SHA1 Сообщение Дата
dbaron%fas.harvard.edu 208b4d5fa6 Attempt to fix build bustage from mkaply's checkin. r=kin 2001-01-30 16:31:43 +00:00
mkaply%us.ibm.com b8aaae7f98 #62003
r=mccabe, sr=brendan
Fixing up some Javascript CALLBACKs
2001-01-30 15:53:38 +00:00
mkaply%us.ibm.com ac97ab347b #62003
r=mccabe, sr=brendan
Fixing up some Javascript CALLBACKs
2001-01-30 15:43:35 +00:00
nboyd%atg.com 7272657a9d Fix bug:
Subject:
             [Rhino] Question
        Date:
             Tue, 30 Jan 2001 20:18:21 +0900
       From:
             "get21" <get21@secsm.org>
 Organization:
             Another Netscape Collabra Server User
 Newsgroups:
             netscape.public.mozilla.jseng




I found something unusual to me when I hacking the Rhino source code.

In tagify method of NativeString Class,

When it adds tag to its string(this.string), it does not use quotation
marks.

For example, the result of tagify("A HREF", "A", value) in
jsFunction_link(String value) is

<A HREF=Some Value>Original String Value</A>

Not,

<A HREF="Some Value">Original String Value</A>

This question might sound silly, but I'm curious why.

Thanks in advance,

Nam

--
email : get21@secsm.org
home : http://get21.secsm.org
phone : 011-9092-1802
2001-01-30 13:47:19 +00:00
brendan%mozilla.org 621cdcc5b2 Better branch callback failure message. 2001-01-29 20:32:57 +00:00
brendan%mozilla.org 86de81d302 Make branch callback optional, parameterize its limit, and give a warning when it fails. 2001-01-29 20:27:30 +00:00
brendan%mozilla.org 27d55355a6 Fixes for bug 33390 (r=mccabe, sr=shaver)
- Optimize compile (parse+emit) operation to generate code for each top-level
  statement or function in turn, recycling JSParseNodes as we go for greatly
  reduced "long linear script" footprint.
- Fix O(n**2) growth problems in bytecode and srcnote generation.
- Add js_ParseTokenStream entry point to compiler, for tree-generation without
  code-generation.  Move JSOP_EVAL instruction selection from code-generator to
  parser, to match other such specializations and enable js_ParseTokenStream.
- Fix js_CompileTokenStream (and get it right in new js_ParseTokenStream) to
  respect JSOPTION_VAROBJFIX.
- Clean up bracing, multi-line conditions, and overlong lines.
2001-01-27 08:00:45 +00:00
rogerl%netscape.com 52a07b9666 Fixes for bugs #66234 (57572, 57631, 61266, 61766) sr=brendan, r=mccabe,
r=rginda,r=rogerl. Also 60925, 60926 by virtue of being subsumed by above.
2001-01-27 00:31:32 +00:00
jeff.dyer%compilercompany.com 90e585d1c8 First cut a xml code generation. 2001-01-26 23:55:32 +00:00
jeff.dyer%compilercompany.com 68c43d84bf Unneeded file 2001-01-26 23:46:06 +00:00
jband%netscape.com 355a6cb803 fix jump in leaks caused by previous checkin by commenting out the offending code that roots Object.prototype 2001-01-26 08:02:23 +00:00
waldemar%netscape.com 677d83f673 Added .() operator 2001-01-26 07:33:32 +00:00
jband%netscape.com 57579a2b2f backing out the unreviewed change to the loader for bug 63027 that I checked in with the other xpconnect changes by mistake. 2001-01-26 02:35:22 +00:00
jband%netscape.com 6bf9fd8163 add xpidl support for DOMString to fix bug 65762. r=jst sr=brendan 2001-01-26 02:32:18 +00:00
jband%netscape.com f74be035ac This is mostly to fix bug 64111 - XPConnect vs. Object.prototype.toSource woes.
Some other small fixes are included. Here is the list...

- Make nsIJSID::id [noscript] because xpconnect automatically builds a nsIJSID
wrapper around nsid values. However, xpconnect does not maintain a table of
those wrappers. So, given the same id twice it will make two nsIJSID wrappers.
This means that property walking could get foo.id.id.id... and not detect that
the different objects represent the same id. nsIJSID already exposes 'number'
so that JS can get the stringified value of the nsid. The nsid struct returned
by 'id' is useful for C++, but only causes problems for JS.

- Fix the nsIXPCScriptable 'IGNORE' handler for GetAttributes to not fail
silently.

- Add 'Components' to global objects as a non-enumerable property for backwards
compatibility and to avoid additional work in property enumeration (esp. in
win.toSource!)

- Expose toSource on wrapped native JSObjects. This just returns an empty object
string: '{}'. It can be overridden by an interface method if present.

- Expose toString on wrapped native JSObjects. It can be overridden by an
interface method if present. Previously we only did this as part of the
Convert op. Now someWrapper.toString will return a callable function.

- Extend the toString behaviour to also print the address of the wrapper in
DEBUG builds only: e.g. "xpconnect wrapped nsIFoo @ 0x12345678". mccabe
convinced me this would be useful. Release build behaviour is unchanged - we
worried that exposing addresses might contribute to possible security exploits.

- Have wrapped native JSObjects use Object.prototype as their proto rather than
have a null proto. Originally this was going to allow delegation to
Object.prototype.toSource, but even without that, this seems like a good thing.
This is implemented by getting Object.prototype from the global object each
time we create a wrapper to allow for spify JS dynamic craziness.

- Use 16bit values in wrappednative property descriptors to save space. It was
only possible to use 16 bits of the pointer-sized ints in the structs anyway.

- Do a security check at enumeration time and only expose those properties that
the caller can actually 'Get'. This fixes the toSource security exception
problem.

- Add a big comment about the problem of reporting uncaught exceptions.

- Fix crashing bug for case where object has no enumerable properties and
xpconnect failed to fill in the zero count.

- Fix NewInstanceJSObject to dig in and find the 'ultimate' parent when
parenting new wrapper JSObject. The old scheme was ending up with hugely
long parent chains in some cases.

r=jst, sr=brendan
2001-01-26 02:25:09 +00:00
jband%netscape.com 42df2f7125 WHITESPACE ONLY CHANGE. Detabbing this stuff cuz it bothers me (tabbing didn't match 'Mode' line's tab-width) 2001-01-26 01:53:22 +00:00
brendan%mozilla.org d5e03229e3 Fixes for bug 61898 (which has morphed), r=rogerl, sr=jband.
- Optimize integer ++ and -- to avoid double-to-int, which is quite costly for
  some compilers (ftol on Windows with MSVC).
- Optimized arguments[i] and arguments.length references to use bytecodes that
  avoid creating an arguments object for the current frame.  This entailed
  simplifying the compiler to avoid flagging functions and scripts that set
  arguments, since we have code in jsfun.c to catch such sets at runtime.
- The code generator now eliminates useless expression statements, giving a
  strict warning about them.
- Rationalized jsemit.c's LookupArgOrVar to have well-defined results in *pn.
  Eliminate bytecode specializations for argument and local variable gets and
  sets from jsparse.c -- these precede jsemit.c's LookupArgOrVar and frustrate
  it, by setting pn_slot non-negative too early.
- Code generation errors set report->filename and report->lineno, rather than
  hacking "{0}, line {1}: " into the localized message.
- Bogus JSFRAME_VAROBJBUG removed, JSOPTION_VAROBJFIX is sufficient.
- Spruce up jsinterp.c macros to use JS_BEGIN/END_MACRO brackets if possible.
- Avoid calling JS_PropertyStub.  The call is too costly compared to a branch
  in the caller.
2001-01-26 00:59:50 +00:00
rogerl%netscape.com 72c26972f0 Fixes to support ICodeModule operand type (via name in global object) and
TRUE/FALSE/NULL/CLASS instructions.
2001-01-25 23:34:33 +00:00
nboyd%atg.com 16564bcb92 ECMA mandates a ToPrimitive on Date constructor arguments that we didn't have. 2001-01-25 19:56:54 +00:00
matthias%sorted.org 71320da674 cleaned up indentation. no code changes. 2001-01-25 18:46:38 +00:00
sspitzer%netscape.com 1f7b9feefe back out brendan (Career Limiting Move) to fix blocker bug #66545.
a=leaf
2001-01-25 18:06:57 +00:00
brendan%mozilla.org bc6f4bf25f Fixes for bug 61898 (which has morphed), r=rogerl, sr=jband.
- Optimize integer ++ and -- to avoid double-to-int, which is quite costly for
  some compilers (ftol on Windows with MSVC).
- Optimized arguments[i] and arguments.length references to use bytecodes that
  avoid creating an arguments object for the current frame.  This entailed
  simplifying the compiler to avoid flagging functions and scripts that set
  arguments, since we have code in jsfun.c to catch such sets at runtime.
- The code generator now eliminates useless expression statements, giving a
  strict warning about them.
- Rationalized jsemit.c's LookupArgOrVar to have well-defined results in *pn.
- Code generation errors set report->filename and report->lineno, rather than
  hacking "{0}, line {1}: " into the localized message.
- Bogus JSFRAME_VAROBJBUG removed, JSOPTION_VAROBJFIX is sufficient.
- Spruce up jsinterp.c macros to use JS_BEGIN/END_MACRO brackets if possible.
- Avoid calling JS_PropertyStub.  The call is too costly compared to a branch
  in the caller.
2001-01-25 09:22:19 +00:00
nboyd%atg.com 6288aee6a5 Move Invoker out as a top-level class so that it doesn't get javadoc'd
with FunctionObject (it must be public).
2001-01-24 15:49:21 +00:00
nboyd%atg.com 4ad47cbac7 Alternative fix for problem in the following email:
Subject:
        minor Rhino bug
   Date:
        Tue, 23 Jan 2001 13:14:51 -0800
   From:
        dave russo <d-russo@ti.com>
     To:
        nboyd@atg.com
    CC:
        d-russo@ti.com




Norris,

While using the new Rhino debugger (from the latest tip) I started to get "No
Context associated with current Thread" exceptions when expanding host objects
in the "Context:" debugger window.

In looking at the code, I discovered that NativeObject.toString seems to assume
that Context.getContext() may return null.  In fact, getContext() always returns
a non-null context or throws an exception.

I changed NativeObject.toString to never throw an exception (see below) and this
eliminated the problem I was seeing (of course).

It would be nice to incorporate this in a future Rhino tip or, if this change is
inappropriate, any guidance would be appreciated.  Thanks in advance.

I changed NativeObject.toString to:

    public String toString() {
        try {
            Context cx = Context.getContext();
            return jsFunction_toString(cx, this, null, null);
        }
        catch (Exception e) {
            return "[object " + getClassName() + "]";
        }
    }

from:

   public String toString() {
        Context cx = Context.getContext();
        if (cx != null)
            return jsFunction_toString(cx, this, null, null);
        else
            return "[object " + getClassName() + "]";
    }
2001-01-24 15:16:37 +00:00
beard%netscape.com 7d89961329 [not part of build] Added UTCUtils to reflect new dependencies in JS engine. 2001-01-23 19:54:49 +00:00
nboyd%atg.com 7378e1c0a4 Subject:
Re: Small usage simplification for Rhino
       Date:
            Tue, 23 Jan 2001 16:01:42 +0100
      From:
            Igor Bukanov <igor@icesoft.no>
        To:
            Norris Boyd <nboyd@atg.com>
 References:
            1 , 2 , 3 , 4




Norris Boyd wrote:

> Thanks. I've patched in your changes and checked it into CVS.

I also looked at other places with similar pattern of few lines of
common code to construct error messages. The following was occurred too
often not to avoid temptations to move it to a separated function:

NativeGlobal.constructError(
Context.getContext(), "TypeError",
ScriptRuntime.getMessage1("msg.default.value", arg),
this)

It can be replaced by
NativeGlobal.typeError1("msg.default.value", arg, this)

There are other similar usages but they are not to frequent to bother
with code reduction because even the above replacement saves just 200
bytes in uncompressed jars (it is expensive to introduce new methods in
Java).

In any case, if you think it makes any sense, patches are attached. They
are made via
diff -cbB javascript.orig javascript > patch_context
diff -bB javascript.orig javascript > patch_std
from org/mozilla directory.

Regards, Igor
2001-01-23 19:35:35 +00:00
nboyd%atg.com 37deb59a1f Fix problem:
Subject:
        Recent rhino broke security support
   Date:
        Tue, 23 Jan 2001 08:07:45 -0500
   From:
        "Kurt Westerfeld" <kurt@managedobjects.com>
     To:
        "Norris Boyd" <nboyd@atg.com>


Norris.....I like the changes made to FunctionObject to do method invocation
much faster.  Very slick.

Problem tho: this mechanism does not veer into the security support plugin
on context for defining a class.  This is crucial do creating event adapter
code later in applet environments.

I'm going to look into this, but perhaps you could probably make the changes
faster than I.

Unfortunately for us, we found this problem yesterday at a customer site.
:-(  Shame on us.

________________________________________________________________________
  Kurt Westerfeld
  Senior Software Architect
  Managed Objects
  mailto:kwester@ManagedObjects.com
  703.770.7225
  http://www.ManagedObjects.com

  Managed Objects: manage technology > rule business
2001-01-23 17:48:41 +00:00
nboyd%atg.com ad55745028 Fix formatting 2001-01-23 14:24:39 +00:00
rogerl%netscape.com 30e631797b More fixes for #64285 - i had mis-merged from SpiderMonkey. 2001-01-22 22:30:37 +00:00
nboyd%atg.com 46510f022a Subject:
Re: Small usage simplification for Rhino
       Date:
            Mon, 22 Jan 2001 20:32:12 +0100
      From:
            Igor Bukanov <igor@icesoft.no>
        To:
            Norris Boyd <nboyd@atg.com>
 References:
            1 , 2




Norris Boyd wrote:

> Sounds like a good change to reduce codesize. I'll take the patches for the
> changes.
>
> Thanks,
> Norris

I made this patch, the files in the attachment were produced via:
diff -bB javascript.orig javascript -c > patch_context
and
diff -bB javascript.orig javascript > patch_std

run from org/mozilla directory.

This patch reduces uncopressed Rhino jar by 3K.

>
> Igor Bukanov wrote:
>
>
>> Hi, Noris!
>>
>> To shorten/cleanup usage of getMessage and reportRuntimeError methods
>> from org/mozilla/javascript/Context.java I suggest to add few utility
>> methods like
>>
>>      static String getMessage0(String messageId) {
>>          return getMessage(messageId, null);
>>      }
>>
>>      static String getMessage1(String messageId, Object arg1) {
>>          Object[] arguments = {arg1};
>>          return getMessage(messageId, arguments);
>>      }
>>
>>      static String getMessage2(String messageId, Object arg1, Object arg2) {
>>          Object[] arguments = {arg1, arg2};
>>          return getMessage(messageId, arguments);
>>      }
>>
>>      static String getMessage3
>>          (String messageId, Object arg1, Object arg2, Object arg3) {
>>          Object[] arguments = {arg1, arg2, arg3};
>>          return getMessage(messageId, arguments);
>>      }
>>
>> and
>>
>>      static EvaluatorException reportRuntimeError0(String messageId) {
>>          return reportRuntimeError(getMessage0(messageId));
>>      }
>>
>>      static EvaluatorException reportRuntimeError1
>>          (String messageId, Object arg1)
>>      {
>>          return reportRuntimeError(getMessage1(messageId, arg1));
>>      }
>>
>>      static EvaluatorException reportRuntimeError2
>>          (String messageId, Object arg1, Object arg2)
>>      {
>>          return reportRuntimeError(getMessage2(messageId, arg1, arg2));
>>      }
>>
>>      static EvaluatorException reportRuntimeError3
>>          (String messageId, Object arg1, Object arg2, Object arg3)
>>      {
>>          return reportRuntimeError(getMessage3(messageId, arg1, arg2,
>> arg3));
>>      }
>>
>> This allows to write, for example, instead of
>>
>>               Object[] args = { Integer.toString(base) };
>>               throw Context.reportRuntimeError(getMessage
>>                                                ("msg.bad.radix", args));
>> simply
>>               throw Context.reportRuntimeError1(
>>                   "msg.bad.radix", Integer.toString(base));
>>
>> which is not only easy to read but also generates less code.
>>
>> I attach my patch to Context.java to implement this plus a patch to
>> ScriptRuntime.java that utilizes the additions. The patches are in
>> standard and context versions.
>>
>> If you think that this make sense to incorporate, I can send a patch
>> that utilizes this everywhere.
>>
>>   ------------------------------------------------------------------------
>>                                  Name: patch.context.Context.java
>>    patch.context.Context.java    Type: Plain Text (text/plain)
>>                              Encoding: base64
>>
>>                              Name: patch.std.Context.java
>>    patch.std.Context.java    Type: Plain Text (text/plain)
>>                          Encoding: base64
>>
>>                                        Name: patch.context.ScriptRuntime.java
>>    patch.context.ScriptRuntime.java    Type: Plain Text (text/plain)
>>                                    Encoding: base64
>>
>>                                    Name: patch.std.ScriptRuntime.java
>>    patch.std.ScriptRuntime.java    Type: Plain Text (text/plain)
>>                                Encoding: base64
>>
>>               Name: all.zip
>>    all.zip    Type: Zip Compressed Data (application/x-zip-compressed)
>>           Encoding: base64
2001-01-22 20:28:34 +00:00
brendan%mozilla.org 7a48de7730 Followup to last checkin, comment change only, r=mccabe. 2001-01-20 02:02:48 +00:00
brendan%mozilla.org f7b7182178 2nd attempt: Fix API botch where 'var x=0' vs. 'x=0' could put x in a different object (65553, r=mccabe, sr=jband). 2001-01-20 01:41:55 +00:00
rogerl%netscape.com 35b3299ba1 Added <function> at top level and example thereof. 2001-01-20 00:44:51 +00:00
rogerl%netscape.com 293f39e59d Fixed gcc warnings. Added .xml test case. 2001-01-20 00:02:56 +00:00
rogerl%netscape.com 5ef03957d6 Fixes and enhancements to get class references, constructors and scripts
working from .xml input.
2001-01-19 23:56:37 +00:00
rogerl%netscape.com 42cccb9acc Merged Monkey bits, fix for bug #57631, /()/ was parsed incorrectly. 2001-01-18 23:39:00 +00:00
rogerl%netscape.com abd7df4119 Merged changes from Monkey - see bug #64285. 2001-01-18 22:49:11 +00:00
kin%netscape.com 254142b18a Temporary fix for Bug #65828: mozilla installer.exe fails with "-229 script error"
Backing out Brendan's previous checkin for bug #65553 (jsapi.c, jsdbgapi.c, jsemit.c, jsinterp.c, jsinterp.h, jsobj.c, and jsscript.c), so we can get smoke tests going.

r=attinasi@netscape.com (sheriff)
2001-01-18 22:10:12 +00:00
brendan%mozilla.org 6016f92494 Fix API botch where 'var x=0' vs. 'x=0' could put x in a different object (65553, r=mccabe, sr=jband). 2001-01-18 03:00:31 +00:00
nboyd%atg.com 8465764458 Subject:
[Fwd: My Mistake in ScriptRuntime method]]]
   Date:
        Tue, 16 Jan 2001 15:48:26 +0100
   From:
        Igor Bukanov <igor@icesoft.no>
     To:
        Norris Boyd <nboyd@atg.com>




Hi, Norris!

With my previous patch to fix in
org/mozilla/javascript/ScriptRuntime.java Integer.MIN_VALUE as index
problem I also added a bug to the unrelated code: I tried to minimize
object creation and unfortunately that untested "optimization" slippet
into my patch as well.

I replaced the lines 290, 291 in toNumber(String s) method from

String sub = s.substring(start, end+1);
if (sub.equals("Infinity"))

to

if (s.regionMatches(start, "Infinity", 0, 8))

But that should be
if (start + 7 == end && s.regionMatches(start, "Infinity", 0, 8))

Sory for troubles, Igor





290c290
<             if (s.regionMatches(start, "Infinity", 0, 8))
---
>             if (start + 7 == end && s.regionMatches(start, "Infinity", 0, 8))
2001-01-16 20:20:36 +00:00
nboyd%atg.com 7f310bd10e Expand tutorial. 2001-01-16 15:24:23 +00:00
nboyd%atg.com dee3b88704 Fix 64788 Make method invocation 10x faster with following code.... 2001-01-14 01:19:58 +00:00
beard%netscape.com af01901779 Keeping up with current Rhino sources. Removed Frame.java, Added DebugFrame.java, DebuggableEngineImpl.java. 2001-01-12 20:42:17 +00:00
beard%netscape.com 2306ac6460 fixed no-prototype function warning. 2001-01-12 20:32:19 +00:00
nboyd%atg.com 045e1a43ae Update comment; operator is part of ECMA. 2001-01-12 16:30:04 +00:00
nboyd%atg.com 03640e82e5 Add removeThreadLocal method. 2001-01-12 16:29:26 +00:00
nboyd%atg.com 89d00fda22 Fix infinite loop in example. 2001-01-12 16:28:36 +00:00
waldemar%netscape.com 143bc061b5 Separated statements into statements, diretives, and definitions 2001-01-12 07:33:19 +00:00
brendan%mozilla.org 383d566ed0 Fix ABW impurities under JS_ClearScope on an unmutated obj (64958, r=shaver, sr=jband). 2001-01-11 23:55:30 +00:00
rogerl%netscape.com bd632f75f4 New (incomplete but functional) implementation of operator overriding. 2001-01-11 00:03:05 +00:00
waldemar%netscape.com 6cec0ffeb7 Simplified use-name-patterns 2001-01-10 02:50:13 +00:00
nboyd%atg.com 7fff00540b 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 11b0510fa7 Missed checkin of new file. 2001-01-09 13:39:22 +00:00
nboyd%atg.com 3d89b59213 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 90fa010e7c Fix for 1.1 compatibility. 2001-01-08 14:34:21 +00:00
nboyd%atg.com 894f03327c Fix classloader problem from last checkin. 2001-01-08 02:13:28 +00:00
nboyd%atg.com 30da0f5260 Canonicalize file names to help debugger. 2001-01-08 02:12:52 +00:00
nboyd%atg.com 90a5ecbdfc Latest changes from Chris Oliver. 2001-01-08 01:43:28 +00:00
nboyd%atg.com 0b68e4b8c2 Revert to old object identity for equality per ECMA. 2001-01-08 01:03:23 +00:00
nboyd%atg.com b29ff78561 For == use .equals after unwrapping. 2001-01-05 20:00:47 +00:00
nboyd%atg.com be4faa6dd5 Fix bug 64397. 2001-01-05 19:15:59 +00:00
nboyd%atg.com b62178de09 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
2001-01-05 01:17:51 +00:00
brendan%mozilla.org d69df4fc93 Speed up js_qsort_r a bit (64065, r=mccabe, sr=jband). 2001-01-04 10:13:18 +00:00
mccabe%netscape.com 7ab63da00c Oops. Removing unneeded 'System.err.println("foo")'. 2001-01-04 00:03:00 +00:00
mccabe%netscape.com a27a43b226 Fix to 64149.
Propagate lexer fixes from Monkey to accept (and warn) about 008 as well as just 08.
2001-01-03 23:36:33 +00:00
nboyd%atg.com 6a47261482 Get rid of BSF file in Rhino code. Just rely upon building BSF ourselves for now. 2001-01-03 20:54:37 +00:00
bryner%uiuc.edu 6862b07fb9 Removing dead .toc files. Not part of build. a=sfraser. 2001-01-03 01:32:06 +00:00
rogerl%netscape.com 43daa9fbee Fix for VC++ compile. 2001-01-02 19:49:16 +00:00
pschwartau%netscape.com ee4c311694 Correcting bug that cropped up when system clock was set to GMT Standard Time 2001-01-01 02:40:28 +00:00
beard%netscape.com 1cf42d06be another pass over LexUtils::cmp_nocase(). 2000-12-30 08:08:12 +00:00
beard%netscape.com 99c888634e fix unsigned/signed comparison warnings 2000-12-30 07:55:01 +00:00
beard%netscape.com df3abcca9b Use GC-safe vector of JSFunction* to hold getters/setters. 2000-12-30 07:46:18 +00:00
beard%netscape.com 99f9432582 no need to copy JSString values into String values. 2000-12-30 07:06:03 +00:00
rogerl%netscape.com ee08ac19b5 Fixed bit-rot in exception handling, removed unused locals. 2000-12-30 01:13:06 +00:00
rogerl%netscape.com b702aaaa6d re-ordered members wrt init sequence. 2000-12-30 01:08:31 +00:00
mccabe%netscape.com 1202414e22 Add emacs makefile modeline.
Not part of the Mozilla build.
2000-12-29 23:23:52 +00:00
rogerl%netscape.com 8b7f5ab4ea Fix for #60164, more failure testing during exception processing.
r=mccabe, a=brendan
2000-12-29 22:19:09 +00:00
pschwartau%netscape.com e5a2adb474 Initial add - 2000-12-29 02:46:32 +00:00
pschwartau%netscape.com eeb1f8d3a4 Adjusting hard-coded Pacific timezone date testcases to work in any tester's timezone - 2000-12-26 20:02:04 +00:00
pschwartau%netscape.com d95b80f20b Adding functionality to adjust hard-coded date tests (written for Pacific timezone) for the tester's own timezone 2000-12-26 19:55:05 +00:00
pschwartau%netscape.com f2b2a38eb0 Modifiying one line that was failing in GMT+ timezones (i.e. east of Greenwich) 2000-12-26 19:34:07 +00:00
waldemar%netscape.com 887b904e59 Revamped the syntax for calling superconstructors and tightened up the syntax for the super operator 2000-12-22 02:02:14 +00:00
mccabe%netscape.com d85aab0c36 Fix courtesy jband to quiet unused variable warning.
Move 'dlsoffset' to the block where it's used, inside #ifdef XP_MAC.

r=mccabe
2000-12-21 04:32:13 +00:00
waldemar%netscape.com 80f4c34351 Simplified postfix-expressions and use-exclude-include 2000-12-21 00:04:52 +00:00
brendan%mozilla.org b2209e4182 Don't fatten a flyweight lock unnecessarily in JS_SetPrototype; misc. cleanups (63097, r=mccabe, sr=jband). 2000-12-20 22:36:01 +00:00
nboyd%atg.com d1b978733a Nope, 8 was right. 2000-12-20 13:31:59 +00:00
waldemar%netscape.com a40dacaf12 Changed 'operator' from a keyword to an attribute. 2000-12-19 01:57:13 +00:00
waldemar%netscape.com e0f8356195 Removed 'operator' non-reserved word 2000-12-19 01:56:36 +00:00
nboyd%atg.com 5a8c30d97f Off by one error fixed. 2000-12-18 19:32:00 +00:00
nboyd%atg.com 68a6e91a65 Add ContextListener to API classes. 2000-12-18 19:30:26 +00:00
beard%netscape.com e1805529ca added newest source files, to use the icode assembler. (Pro6 update) 2000-12-16 07:01:50 +00:00
beard%netscape.com a74f4fe519 added newest source files, to use the icode assembler. 2000-12-16 07:01:22 +00:00
beard%netscape.com 40289e5bf6 use string8::difference_type rather than uint for difference between iterators, cast uint32 to int32 to remove warnings. 2000-12-16 06:57:58 +00:00
beard%netscape.com 0923d081e7 fixed return value warning by moving return statement. 2000-12-16 06:56:37 +00:00
beard%netscape.com e76108030e warnings, explicit use of JSValue constructor. 2000-12-16 06:54:40 +00:00
waldemar%netscape.com e1b29f5bf1 Converted to CodeWarrior 6 and fixed errors 2000-12-16 01:14:55 +00:00
waldemar%netscape.com 968afb2ede Fixed C++ errors 2000-12-16 01:14:36 +00:00
jeff.dyer%compilercompany.com d2eb2e3974 Revised readme and removed CommandLine parser (for now). 2000-12-16 00:50:25 +00:00
jeff.dyer%compilercompany.com 42bf173cf4 Removing Util.java. 2000-12-16 00:43:05 +00:00
jeff.dyer%compilercompany.com e3fbb79593 Removed dependency on sun.tools packages. 2000-12-16 00:42:16 +00:00
rogerl%netscape.com adeb9ce419 Added 'length' to Array objects as a getter property - and fixed up stuff
that this depended on. Fixed parameter names for xml classes and added
'loadxml' global function.
2000-12-15 01:38:40 +00:00
beard%netscape.com 990c190112 Converted to an application for testing. 2000-12-15 01:26:06 +00:00
beard%netscape.com 9e38607680 JDK 1.1 compatibility. Should flesh out the CommandLine class to do what sun.tools.util.CommandLine does. 2000-12-15 01:09:58 +00:00
beard%netscape.com 2db4c0cf57 JDK 1.1 compatibility. 2000-12-15 01:06:50 +00:00
beard%netscape.com d539a4f663 build system for Mac using CW Pro 6. 2000-12-15 01:05:32 +00:00
beard%netscape.com 52c83e4bad Removing obsolete furballs. 2000-12-15 00:04:31 +00:00
beard%netscape.com 3106d6f488 Removing obsolete furball. 2000-12-15 00:01:26 +00:00
nboyd%atg.com 20f7c9cf5d Fix bug:
Subject:
             [Rhino] Script compiler bug?
        Date:
             Tue, 12 Dec 2000 22:08:23 GMT
       From:
             dave russo <d-russo@ti.com>
 Organization:
             Deja.com
 Newsgroups:
             netscape.public.mozilla.jseng




The following script does not seem to compile properly (using Rhino
1.5R1):

test.js:
var test = {};
test.foo = function () { print('foo')}
test.bar = function () { print('bar')}

After compiling test.js ("java org.mozilla.javascript.tools.jsc.Main
test.js"):

js> loadClass('test')
js> test.foo()
bar
js> load('test.js')
js> test.foo()
foo

Note that changing test.js to read:

var test = {};
test.foo = function foo() { print('foo')}
test.bar = function bar() { print('bar')}

Works around the problem.  Is there a problem with anonymous functions?


Sent via Deja.com
http://www.deja.com/
2000-12-13 15:17:24 +00:00
nboyd%atg.com 88e4c7591d Missed call to "in" needing parameter change. 2000-12-13 14:47:27 +00:00
nboyd%atg.com 7de24971c5 Support single-letter bean properties. 2000-12-12 20:29:06 +00:00
nboyd%atg.com 62e1afa949 Fix test case failures with RegExp constructor (new tests) 2000-12-12 15:19:36 +00:00
nboyd%atg.com 9fc201edd5 Fix ArrayIndexOutOfBoundsException on "new RegExp()" 2000-12-12 14:51:55 +00:00
nboyd%atg.com 143829c7ce Fix 62559, 58479 2000-12-12 14:35:38 +00:00
nboyd%atg.com 0edcf54d33 fix javadoc 2000-12-12 01:48:53 +00:00
pschwartau%netscape.com 8f19425415 Skip ecma_3/Date/15.9.5.7.js Rhino does Date.toLocaleTimeString() differently than SpiderMonkey 2000-12-12 00:13:24 +00:00
nboyd%atg.com c8ab1211ff Fix bug where "a = new Array[3]" would produce an IndexOutOfBoundsException 2000-12-10 18:33:52 +00:00
mccabe%netscape.com 2fe07882cc Fix to 62309. Change JS_AddRoot to JS_AddNamedRoot in Liveconnect to aid leak diagnoses.
r=beard
sr=brendan
2000-12-09 01:35:46 +00:00
rogerl%netscape.com 069e9baacd Sweeping set of changes to implement closures. Also re-targetted entire
front-end to Cobol and back-end now generates pdp11 assembly code in
spanish.
2000-12-08 23:55:39 +00:00
mccabe%netscape.com abdaf190a6 More licenses and modelines.
Not part of the Mozilla build.
2000-12-08 10:19:59 +00:00
mccabe%netscape.com 4fa75fb716 Add informative comment.
Not part of the Mozilla build.
2000-12-08 10:01:35 +00:00
mccabe%netscape.com d04a849968 Whoops, wrong license. 2000-12-08 10:00:20 +00:00
mccabe%netscape.com d04afd6262 Add -p flags to several Makefile mkdir commands, to allow parallel gmakes. Still not sure how to make js/src/liveconnect/classes/*.java happy with parallel. gmakes...
Also add some #modelines to makefiles, and some more NPL licenses.

None of these files are part of the Mozilla build.
2000-12-08 09:56:47 +00:00
mccabe%netscape.com e548353c35 Update to last fix of js.c. Multiple versions of functions #ifdef'ed to take different numbers of arguments (in C) are a pain. Use #ifdef-safe JS_GET_CLASS, instead.
Not part of the Mozilla build.
2000-12-08 06:30:57 +00:00
mccabe%netscape.com 19d6cc69f6 Fix to Windows build problem with the js reference build; replace non-API macro OBJ_GET_CLASS with API-kosher JS_GetClass. (OBJ_GET_CLASS used js_GetSlotWhileLocked, pulled from the set of exported symbols with the recent thread optimization checkin.)
Not part of the Mozilla build.  (Yes, it's a closed tree!)

r=brendan
2000-12-08 02:35:17 +00:00
cls%seawood.org 2c34b69f67 Adding caps to REQUIRES. Bug #62069 r=burning tinderbox: senna 2000-12-07 22:46:13 +00:00
mccabe%netscape.com 78aaa08ebc Fix to 58120 - Rhino's Date.prototype.setYear wasn't converting from internal UTC time to local time before working with the date, resulting in new dates that were off by the current timezone offset. Adding a LocalTime call fixes it.
Thanks to David Flanagan <david@oreilly.com> for catching this.
2000-12-07 09:21:45 +00:00
jband%netscape.com bcc3c85a43 now that the bustage is cleanedup (sorry), I'm fixing the whitespace of that hasty checkin 2000-12-07 09:06:55 +00:00
jband%netscape.com ca8db95467 fix build bustage on some platforms from MI ambiguity 2000-12-07 08:33:50 +00:00
jband%netscape.com 45128b707e fix bug 62069 and bug 68538 by using nsISecurityCheckedComponent to allow unfettered access from JavaScript to Components.interfaces and the safer methods on nsXPCException. r=brendan r=mstoltz sr=hyatt 2000-12-07 08:14:27 +00:00
mccabe%netscape.com 9911434787 Add emacs makefile modeline to many makefiles, add npl license to others.
(Comment changes only.)
2000-12-07 02:44:27 +00:00
pschwartau%netscape.com df9bcf627c Initial add; regression test for Bugzilla bug 57043 2000-12-06 20:52:59 +00:00
jeff.dyer%compilercompany.com db887022c7 Corrupt. Removing. 2000-12-06 19:01:21 +00:00
jeff.dyer%compilercompany.com f8cff9b320 Removing, corrupt. 2000-12-06 18:59:39 +00:00
jeff.dyer%compilercompany.com ec4d373ded Drawing of compile-time values. 2000-12-06 18:37:20 +00:00
jeff.dyer%compilercompany.com f8ae9bf2de Fixed test to be correct js2. 2000-12-06 18:30:18 +00:00
jeff.dyer%compilercompany.com 21eef8c0a2 Fixes to the type system and error handler. 2000-12-06 18:27:42 +00:00
brendan%mozilla.org d20bef443d Fix leak on IS_BIG_ENDIAN malloc failure early return (r=mccabe,sr=jband). 2000-12-06 06:53:33 +00:00
brendan%mozilla.org bfe244979f Include <ctype.h> before using isalpha, etc.; misc style cleanup (r=mccabe,sr=jband). 2000-12-06 06:46:55 +00:00
jband%netscape.com 0666f237d9 fix bug 59588. Since js_MarkAtom is called *so* often but is usually short-circuited, we add a macro to get the shortcircuit flag in the 3 callers and avoid most of the calls. r=mccabe sr=brendan 2000-12-06 06:03:30 +00:00
jband%netscape.com 33f4835a09 fix bug 61788 - don't leave garbage in stack from js_AllocStack. Also, avoid allocing unneeded slots. r=mccabe sr=brendan 2000-12-06 06:00:49 +00:00
jband%netscape.com b33bf4ec79 fix warnings 2000-12-06 05:59:16 +00:00
brendan%mozilla.org 49c564a725 JSPROP_SHARED implies no slot to entrain garbage (bug 61482, r=mccabe, sr=jband). 2000-12-05 21:47:23 +00:00
nboyd%atg.com 49ddafb80f Add construction of Counter from Java 2000-12-05 16:42:39 +00:00
nboyd%atg.com c51217064b Fix bug 61979 2000-12-05 16:06:20 +00:00
nboyd%atg.com 1bd9797c1d Fix bug 60093 2000-12-05 16:04:32 +00:00
brendan%mozilla.org 977ca0b14a Forgot to check this in as part of 54743's big patch, d'oh\! 2000-12-05 06:42:14 +00:00
mccabe%netscape.com c8171ec7cc Fix to 45590. Beard untangled ancient and wrong code from prmjtime.c interacting with the Mac OS; 45590 is fixed by actually treating the date offset as a signed value (it should be!) rather than adding a day when east of Greenwich.
Along the way, Patrick also fixed a bug that's been with the JS engine on the mac for more than three years; used to be that Mac dates throughout the year were displayed according to the machine's *current* daylight savings time setting; now they display properly and all is well with the world.

Dependent on recent checkin fixing 61577, adding needed time library to the mac build.X

r=mccabe
2000-12-05 05:17:30 +00:00
brendan%mozilla.org 58badac28d Checkin for art@halogen.kharkov.ua, bug 61899, r=mccabe, sr=brendan. 2000-12-05 03:16:41 +00:00
pschwartau%netscape.com 95b6a804bd Replaced hard-coded TZ_DIFF = -8 with a dynamically-calculated value 2000-12-05 01:47:15 +00:00
jeff.dyer%compilercompany.com 7ecfd468ed Fixed type bugs and header comments. 2000-12-04 18:47:28 +00:00
brendan%mozilla.org ef455e7028 A bit over-aggressive with that static keyword last time... 2000-12-04 04:34:18 +00:00
brendan%mozilla.org 6c9e3d3542 Fix NSPR_LOCK ifdefs (for JS_NO_THIN_LOCKS mode, enabled due to a configure.in bug on gcc/sparc5 systems). Fixes speedracer build bustage. 2000-12-04 04:02:27 +00:00
brendan%mozilla.org 606546fd75 All this r=mccabe, r=beard, and sr=jband -- many thanks to all who helped,
especially to jband for his great stress-test setup and particularly helpful
(in terms of reproducing bugs in draft patches) MP and laptop machines.

- Radical(*) object (scope) locking optimization: don't lock if a scope is
  accessed on the context that exclusively owns it (initially, the context
  on which the scope was created).  Once a scope becomes shared among more
  than one owner-context, give it the usual thin or fat lock, per existing
  jslock.c code.

  I did this at the memory cost of another word per JSScope, ownercx, which
  raised scope size from 12 to 13 words if !DEBUG.  I also added a linked
  list head pointer, rt->scopeSharingTodo, and a scopeSharingDone condition
  variable to JSRuntime, and a scopeToShare pointer to JSContext that's
  necessary for deadlock avoidance.

  The rt->scopeSharingTodo list links JSScopes through the scope->u.link
  union arm, which overlays the pre-existing scope->count (now u.count)
  member.  This list holds scopes still exclusively owned by a context, but
  wanted by js_LockScope calls active on other threads.  Those calls wait
  on the rt->scopeSharingDone condition, which is notified every time an
  owner-context ends the request running on it, in which code active on
  that context may be using scope freely until end of request.

  The code that waits on rt->scopeSharingDone must first suspend any and
  all requests active on the calling context, and resume those contexts
  after the wait is notified.  This means a GC could happen while the
  thread locking a scope owned by another thread's context blocks; all
  calls to JS_LOCK_OBJ must therefore first home fp->sp above any live
  operands, e.g.  The interpreter takes care to do that already.

  To avoid AB-BA deadlocks, if a js_LockScope attempt on one context finds
  that the owner-context of the scope is already waiting on a scope owned
  by the current context (or indirectly depending on such a scope lock),
  the attempt converts the scope from lock-free exclusive ownership to
  shared ownership (thin or fat lock).

- Fix js_SetupLocks and the js_LockGlobal/js_UnlockGlobal code to avoid
  divmod instruction costs, strength-reducing to bit-mask instructions.

- The radical lock-free scope change required care in handling the 0=>1
  and 1=>0 transitions of cx->requestDepth, which was till now thread-local
  because part of the JSContext not manipulated by other threads.  It's
  still updated only by cx's thread, but it is read by other threads in
  the course of attempting to claim exclusive ownership of a scope for more
  lock-free JS object operations.

- The JS_SuspendRequest and JS_ResumeRequest APIs have changed incompatibly
  to require their caller to save and restore the requestCount found when
  JS_SuspendRequest is called.  This is necessary to avoid deadlock; sorry
  for the incompatible change.

- Fixed various nits in jslock.[ch], including using Init/Finish rather
  than New/Destroy for the methods that take a JSThinLock and initialize
  and finish/free its members.  Another example: JS_ATOMIC_ADDREF is now
  JS_ATOMIC_INCREMENT and JS_ATOMIC_DECREMENT, so the two cases can be
  mapped to PR_AtomicIncrement and PR_AtomicDecrement.  This entailed
  changing jsrefcount from jsword to int32 (PRInt32).

- No need to use JS_ATOMIC_INCREMENT on JSScopeProperty.nrefs, as it is
  always and everywhere protected by the property's JSScope.lock.

- Cleaned up gratuitous casts in jscntxt.c by using &cx->links, etc.

- The lock used for mutual exclusion around both request begin and end vs.
  GC synchronization is rt->gcLock, and this lock now also protects all
  scope->ownercx pointer changes from non-null (exclusive) to null (shared),
  the rt->scopeSharingTodo/scope->u.link list operations, and of course the
  rt->scopeSharingDone condition.

  But this means that js_GC cannot hold rt->gcLock across the bulk of its
  body, in particular the mark phase, during which JS_GetPrivate calls,
  e.g., may need to "promote" scope locks from lock-free to thin or fat,
  because doing so would double-trip.  There never was any good reason to
  hold rt->gcLock so long, of course -- locks are for mutual exclusion, not
  for waiting or notifying a thread -- those operations require a condition,
  rt->gcDone, which we already use along with rt->gcLevel to keep racing GC
  attempts at bay.

  So now that rt->gcLock does not protect the mark phase, the enumeration
  of rt->gcRootsHash can race badly with JS_RemoveRootRT, an API that may
  legitimately be called outside of a request, without even a context.  It
  turns out that people may be cheating on the request model even with
  JS_AddRoot, JS_AddNamedRoot, and JS_RemoveRoot calls, so we must make
  all of those interlock with the GC using gcLevel and gcDone, unless they
  are called on the gcThread.

  Also, since bug 49816 was fixed, there has been no need for a separate
  finalize phase, or for rt->gcFinalVec.  Finalizers can no longer allocate
  newborn GC-things that might be swept (because unmarked), or double-trip
  on rt->gcLock (which is no longer held).  So js_GC finalizes as it sweeps,
  just as it did in days of old.

- I added comments to jslock.h making it plain that callers of JS_LOCK_OBJ
  and JS_UNLOCK_OBJ must either be implementations of js_ObjectOps hooks,
  or code reachable only from those hooks; or else must be predicated on
  OBJ_IS_NATIVE tests.  It turns out jsinterp.c's CACHED_GET and CACHED_SET
  macros neglected to do such tests, limiting the ability of JS embeddings
  to implement JSObjectOps with their own non-JSScope JSObjectMap subclass.
  Fixed, small performance hit that the lock-free optimization should more
  than make up for.

- jslock.c now gives a #error if you try to compile it on a platform that
  lacks a compare-and-swap instruction.  The #error says to use NSPR locks.
  Before this change, some platforms would emulate compare-and-swap using
  a global PRLock, which is always worse in runtime than using per-scope
  PRLocks.
2000-12-04 02:43:31 +00:00
jband%netscape.com 9467ba676e remove unnecessary nested JS_{Begin,End}Request in Load. r=beard 2000-12-04 02:13:13 +00:00
cls%seawood.org f518d8fb8f Update REQUIRES. 2000-12-03 22:33:51 +00:00
pschwartau%netscape.com a9e6050906 Removed hard-coded line var TZ_DIFF = -8. It's already set in the pre-loaded shell.js file. 2000-12-02 23:59:58 +00:00
waldemar%netscape.com 3c3fe52071 Made 'super' into an operator. Added syntax for operator overloading. 2000-12-02 09:10:12 +00:00
waldemar%netscape.com 907e88a921 Added 'operator' non-reserved word 2000-12-02 09:09:41 +00:00
jeff.dyer%compilercompany.com e1e34965e1 Fixed a couple typos. 2000-12-02 02:04:51 +00:00
jeff.dyer%compilercompany.com 0305f2d290 Updated to reflect latest changes. 2000-12-02 01:49:18 +00:00
jeff.dyer%compilercompany.com 0f99399a6e Import of Initial Source from MVCC 2000-12-02 00:46:31 +00:00
pschwartau%netscape.com 643e118e14 Initial add; see Bugzilla bug 61266 - 2000-12-01 20:20:43 +00:00
pschwartau%netscape.com e2e1752e2e Initial add; see Bugzilla bug 57631 2000-12-01 20:17:11 +00:00
jband%netscape.com eaf3928939 fixes for bug 60303, bug 60356, bug 57370, and bug 58982 r=mccabe sr=hyatt sr=brendan 2000-11-30 06:58:37 +00:00
mccabe%netscape.com 6df0ad455d Fix to 61183. Detect whether the OS has given us a date string ending in /xx (as in xx/xx/xx) for Date.prototype.toLocale[Date]String, and pad it out to the real number of digits.
r=rogerl
2000-11-30 05:52:44 +00:00
mccabe%netscape.com 93184e2bfe Remove unused property definitions and fix some errors that had crept in. 2000-11-29 23:32:53 +00:00
mccabe%netscape.com b93f77c5b2 Twiddle Make usage message. 2000-11-29 22:36:06 +00:00
mccabe%netscape.com d9cd56c60b Fix to 58673. Alias Date.prototype.toGMTString to Date.prototype.toUTCString (rather than defining seperate function objects for each). ECMA conformance.
r=rogerl
2000-11-29 03:03:05 +00:00
mccabe%netscape.com 1509017ef1 Fix to 57048. Bring the JS engine's implementation of Object.prototype.propertyIsEnumerable in line with the ECMA spec.
Thanks to David Flanagan for noticing this problem.

r=rogerl
2000-11-29 02:05:10 +00:00
mccabe%netscape.com 6105620bbc Restore toplevel Makefile (with an added note in the usage message about it's new limitations wrt debugger and bsf) and update the js library makefile to account for changed files. 2000-11-28 21:24:41 +00:00
nboyd%atg.com 1d790c4961 Fix bug 61267. 2000-11-28 16:23:24 +00:00
mstoltz%netscape.com 668715ee7b bug 59766. Added code to push current JS context onto context stack before all LC calls into JS, becuase the security manager looks on the context stack for permission info. r=jband, mccabe 2000-11-28 02:50:21 +00:00
beard%netscape.com 870fcd146a Keep JDK 1.1 compatible. 2000-11-27 23:40:15 +00:00
nboyd%atg.com ac975755b3 Sense JDK1.3 dependencies. 2000-11-27 22:23:40 +00:00
pschwartau%netscape.com 807f22a27f Removing outdated testcase. See Bugzilla bug 49233. 2000-11-27 19:39:18 +00:00
pschwartau%netscape.com c9886e3a1e Removing outdated testcase. See bug 49233. 2000-11-27 19:32:41 +00:00
nboyd%atg.com a218a1a793 Add hasProperty and use it for the 'in' operator 2000-11-27 17:46:56 +00:00
nboyd%atg.com d05cf1d8e6 Fix 19734, accepting patch 2000-11-27 15:13:35 +00:00
nboyd%atg.com 03243413e6 Switch to ant for building. 2000-11-27 15:04:48 +00:00
nboyd%atg.com e33e06b0e8 Add debugger contribution from Christopher Oliver. 2000-11-27 15:00:45 +00:00
pschwartau%netscape.com daa5773e5c Initital add - 2000-11-27 01:22:47 +00:00
pschwartau%netscape.com fb875c9e90 Adding shell.js for ECMA3 Date tests, and tests for ECMA3 15.9.5.3 - 15.9.5.7 2000-11-25 01:17:24 +00:00
beard%netscape.com 9b8ac41686 importable XML project for CWPro6. 2000-11-23 04:27:33 +00:00
beard%netscape.com 2736e7e776 removed import of non-existent org.mozilla.javascript.tools.debugger.* package. 2000-11-23 04:24:34 +00:00
nboyd%atg.com 0380d9c7d9 * 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
waldemar%netscape.com 6cd25e1b96 Added support for white space. Removed initial / production. 2000-11-21 04:07:05 +00:00
waldemar%netscape.com fa7d21a130 Renamed simple to span 2000-11-21 04:06:44 +00:00
brendan%mozilla.org e21159cb73 Store real JSString*, not address of auto JSSubString, in local root (60674, r=beard, sr=jband). 2000-11-21 00:51:43 +00:00
beard%netscape.com 6c99e43e31 updated dependencies 2000-11-21 00:31:10 +00:00
beard%netscape.com e1e12894c0 added explicit getString() method to StringFormatter, and removed operator String() methods. 2000-11-21 00:29:39 +00:00
beard%netscape.com 785eaacfb2 Made getStaticSlot() static, to remove warning. 2000-11-21 00:15:39 +00:00
beard%netscape.com 8329d7a4b6 fixing unsigned/signed conversion warnings. 2000-11-21 00:14:55 +00:00
nboyd%atg.com 7d318fbd85 Merge debugger changes into trunk. 2000-11-20 16:16:32 +00:00
nboyd%atg.com b7d36f7601 Fix for updated filename. 2000-11-20 14:44:56 +00:00
cls%seawood.org 8bd122b3d5 Resurrect REQUIRES so that we have some sort of means to track intermodule dependencies. Bug #59454 r=blizzard@mozilla.org 2000-11-20 07:16:06 +00:00
pavel%gingerall.cz 3f402edbe2 - script compilation support (JS::CompileScript)
- compiled script may be executed (JS::exec)
- memory leak fixed
  (JSVALtoSV returning objects; magic has to to a mortal value)
2000-11-19 14:40:33 +00:00
beard%netscape.com 24a6cc787c CW Pro 6 compatibility. 2000-11-18 03:14:07 +00:00
nboyd%atg.com fb39f788bc timestamping file 2000-11-18 02:24:06 +00:00
nboyd%atg.com 387cf7985c Add support in Rhino for BSF without the bsfengines.jar. 2000-11-18 02:14:46 +00:00
danm%netscape.com b9887b3ac3 removing glowcode directives. won't affect you unless you use an obsolete version of glowcode. 2000-11-18 02:13:42 +00:00
nboyd%atg.com 2e9a2bd01f Fix 60184, and add SwingApplication.js example, with change
to shell to prevent early exit.
2000-11-17 13:05:46 +00:00
rogerl%netscape.com 0f1b1996aa Added lexutils & exception... to default build. 2000-11-16 23:58:53 +00:00
rogerl%netscape.com 3923459330 Example from Waldemar's spec. 2000-11-16 23:50:37 +00:00
rogerl%netscape.com c65d7b8376 Added BindThis argument, removed 'this' arg from Call. 2000-11-16 23:49:29 +00:00
rogerl%netscape.com 8ccb885553 Added notion of binding a 'this' to a method to construct a mini-closure
for call semantics. Fixed MSVC warnings from lexutils. Added BindThis
instructionand removed 'this' from Call instruction (is now extracted
from target argument).
2000-11-16 23:48:42 +00:00
mccabe%netscape.com 92e9039cb0 Not part of the Mozilla build. Update tool paths for server build. 2000-11-16 00:03:20 +00:00
mccabe%netscape.com dea57eb30f Not part of the Mozilla build. Add js and liveconnect config files for OSFV5.0 2000-11-15 23:57:49 +00:00
nboyd%atg.com 09771a8b39 Subject:
[Rhino] importPackage() when not in Rhino shell?
        Date:
             Tue, 14 Nov 2000 09:37:39 -0000
       From:
             "Benjamin Geer" <geerb@midas-kapiti.com>
 Organization:
             Another Netscape Collabra Server User
 Newsgroups:
             netscape.public.mozilla.jseng




The importPackage() and importClass() functions provided by the Rhino shell
seems as if they would be very generally useful.  Unless I've missed
something, they don't seem to be available to scripts compiled using the
JavaScript compiler, or to scripts that are run using Script.exec().  Is
there any chance these functions could be made available for all scripts to
use?  This would save a lot of typing; one could then always write a = new
Foo() instead of a = new Package.com.baz.bar.foo.Foo().

--Benjamin Geer
2000-11-14 20:10:42 +00:00
nboyd%atg.com 72a244c2da Update javadoc. 2000-11-14 20:08:53 +00:00
nboyd%atg.com 8db6eec108 Fix bug:
slobo@espial.com wrote:
>
> Hello Mike
>
> In the following test case, tester returns "undefined cat" in Rhino
> while in NN it returns "meow cat".
>
> Thanks
>
> Steven
>
> /////////////////////////////////////////////////////////////////////
> function tester(nest){
>     var nest = nest+" cat";
>     alert(nest);
>     // nest now contains the value undefined.
> }
>
> tester("meow");
2000-11-14 13:30:55 +00:00
rginda%netscape.com 806cf8e188 refactored lexer bits from icodeasm into lexutils
refactored exceptions from icodeasm into exception*
fixed LeadingCap method names to be interCapped
added string8 and string16 typedefs (as opposed to string vs String)
2000-11-14 03:11:54 +00:00
nboyd%atg.com 58b79a147b Subject:
More changes to support non NativeJavaObject wrappers
   Date:
        Fri, 03 Nov 2000 17:56:38 +0100
   From:
        Igor Bukanov <igor@icesoft.no>
     To:
        nboyd@atg.com




Hi, Norris,

In post 1.5 rhino one can introduce own wrappers for arbitrary Java
objects. But I think to fully support this
org.mozilla.javascript.ScriptRuntime should be changes as well: its eq
and shallow_eq contain references to NativeJavaObject, this should be
replaced at least to Wrapper (see the atached patch). Even better
solution would be to add to WrapHandler methods to compare wrappers: I
can send a patch for that as well.

There is a small usability problem as well: if
org.mozilla.javascript.JavaMembers would be public I do not need to copy
it to a package with non NativeJavaObject.java wrapper.

Regards, Igor
2000-11-13 22:10:35 +00:00
jeff.dyer%compilercompany.com 843e30ec1a Fix the first startup test. 2000-11-08 21:05:58 +00:00
mccabe%netscape.com 1691baff22 Fix to 58946.
Make try { ... } catch(exn) { return exn } work by ensuring that the return value (exn) is maintained on the stack as we pop off scopes to return from the try/catch/finally.  The newly added JSOP_SWAP opcode helps us bubble.

This fixes a regression uncovered by the fix to 56716.

(I've noticed that this causes *depend* builds of the standalone JS shell to crash on this construct, but I've tested in the Mozilla build, and the dependencies seem to solve the problem there.)

r=brendan.mozilla.org
sr=jband@netscape.com
2000-11-08 20:39:43 +00:00
beard%netscape.com 06b45baadc Replaced occurrences of $$, $1, $2 with result, first, second. CodeWarrior doesn't like $ characters in identifiers. 2000-11-08 19:50:39 +00:00
pschwartau%netscape.com 8171a0962f The const keyword is non-ECMA and not currently implemented in Rhino 2000-11-08 01:10:43 +00:00
pavel%gingerall.cz 7ac6f89e90 - jsperl.c compiled with js programm, not with libjs
- better JS value tie methods
- memory leaks fixed
- support of digging native js error from exception
2000-11-07 15:24:49 +00:00
nboyd%atg.com 0f96b20b62 Clean up debug APIs 2000-11-07 03:20:56 +00:00
rogerl%netscape.com 0a6215f169 Fixed warnings & bogus qualifier. 2000-11-07 01:09:45 +00:00
rogerl%netscape.com 5a3c3bbedc Fixed statics and constructors bitrot. 2000-11-07 00:59:27 +00:00
rogerl%netscape.com 9468068269 More tests and changed 'verify' to live separately. 2000-11-07 00:58:42 +00:00
rogerl%netscape.com d56d1d28c0 Testcase for adding setter to non-final field. 2000-11-06 23:00:00 +00:00
rogerl%netscape.com 7f2318fcc5 Fixed compare bugs. Report results from js2 test cases. Rewrote generic
equal to match ECMA 1.5
2000-11-06 22:57:10 +00:00
waldemar%netscape.com c4904771e2 Defined UseIncludesExcludes. Removed support for a:🅱️:c. 2000-11-04 10:47:47 +00:00
waldemar%netscape.com a16abdbf7e Added 'include' and 'exclude' non-reserved words 2000-11-04 10:46:24 +00:00
mccabe%netscape.com 8a87f76dc2 Fix to 58008. Add missing ECMA-specified fuctions Date.prototype.toDateString, toTimeString, toLocaleDateString, toLocaleTimeString. Commoned some code to toLocale_helper and date_format.
Also make several formerly class static variables lazily initialized.
2000-11-03 21:28:49 +00:00
rogerl%netscape.com 18a5e3a269 More tests 2000-11-03 02:42:23 +00:00
rogerl%netscape.com 7b8898dcf1 Fixed adding setter to virtual inherited field. 2000-11-03 02:42:01 +00:00
pschwartau%netscape.com 5fb5604727 initial add 2000-11-03 02:27:44 +00:00
jeff.dyer%compilercompany.com 94f99233df Don't care if required named come after optional named parameters. 2000-11-03 01:44:30 +00:00
rogerl%netscape.com 1851703e79 Fixed bogus rest reference, added named tests. 2000-11-02 19:40:42 +00:00
mccabe%netscape.com 1cb16802f8 Fix previous fix to conform to brendan-nit. 2000-11-02 03:38:09 +00:00
mccabe%netscape.com 980b771c8d Fix to 58007. Add Date.prototype.toDateString, toTimeString methods, by commoning existing date_format helper function with toString. ECMA-262 ed. 3 conformance.
r=brendan@mozilla.org
sr=jband@mozilla.org
2000-11-01 23:57:37 +00:00
nboyd%atg.com 35f28776c5 Upgrade to Ant 1.2 and remove deprecated tasks. 2000-11-01 18:43:55 +00:00
rogerl%netscape.com e74eea4764 Fixed signed/unsigned whinage. 2000-11-01 02:04:04 +00:00
rogerl%netscape.com 56310a15c2 Simple call tests. 2000-11-01 01:55:46 +00:00
rogerl%netscape.com 2edfa7302d Fixed rest parameter index handling. 2000-11-01 01:55:13 +00:00
rogerl%netscape.com 375bd5d07d Fixed signed/unsigned whine. 2000-11-01 01:48:15 +00:00
rogerl%netscape.com 2e5785dfe5 Fixed JSArray for 1.5 semantics stuff. Changed readEvalFile to stop
doing line at a time nonsense. Fixed ExprNode::Index cases to use
InvokeExprNode instead of Binary.
2000-11-01 01:39:43 +00:00
mccabe%netscape.com 82a15a1687 Fix sense of don't-fail-on-warning check propagated from js.c.
Thanks to John Bandhauer for the catch.

Not part of Mozilla.
2000-10-30 22:42:48 +00:00
nboyd%atg.com c109da414a Fix bug 57060 for/in loop enumerates array elements as numbers, not strings 2000-10-30 19:46:02 +00:00
nboyd%atg.com fa72e89acf Fix bugs:
56318  function literals with names don't work right
57045  negative integers as object properties: weird behavior
58479  functions defined within conditional phrases are always crea
2000-10-30 19:34:11 +00:00
shaver%mozilla.org f188006b0a #56716, run finally{} before return from try{}/catch{}, r=mccabe, sr=brendan 2000-10-29 18:54:58 +00:00
brendan%mozilla.org 9d7b76c742 Use 0 - i rather than -i to avoid unsigned warning on Windows. 2000-10-29 18:08:40 +00:00
nboyd%atg.com d223b095ba Fix formatting 2000-10-29 18:07:26 +00:00
brendan%mozilla.org cb814a824f Handle negative-int-fits-in-jsval string literals as property names equivalent to their int conversions (57043, r=shaver, sr=jband). 2000-10-29 01:30:16 +00:00
waldemar%netscape.com 139931c770 Allowed multiple units in a unit expression 2000-10-28 05:55:47 +00:00
waldemar%netscape.com b65d4f2f46 Renamed OrdinaryInitialIdentifierCharacter and OrdinaryContinuingIdentifierCharacter to InitialIdentifierCharacter and ContinuingIdentifierCharacter 2000-10-28 05:55:19 +00:00
waldemar%netscape.com c8e5c8c645 Initial version 2000-10-28 05:54:44 +00:00
waldemar%netscape.com e25ff660ba Added JS20/Units 2000-10-28 05:53:23 +00:00