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

3534 Коммитов

Автор SHA1 Сообщение Дата
rginda%netscape.com 5ab2adfee9 - not built -
add jsdIEphemeral interface, inherit from it in interfaces that need to.
2001-07-03 22:22:58 +00:00
rginda%netscape.com a29db3ffa9 - not built -
move debug object counters and various constructors to jsd_xpc.cpp
add LiveEphemeral struct to reperesent a link in a PRCList of ephemeral objects.
declare jsdIEphemeral interface in objects that need it, add invalidaAll static method to jsdIProperty and jsdIValue.  jsdIObject still needs work.
2001-07-03 22:21:56 +00:00
rginda%netscape.com b96fa36548 - not built -
Large changes to improve the way we deal with our wrappers around js engine structures.  jsdIScript, jsdIStackFrame, jsdIValue, and jsdIProperty interfaces now inherit from a new interface "jsdIEphemeral".  This interface is used to invalidate the wrapper.  Once the wrapper is invalidated, *most* methods throw NS_ERROR_NOT_AVAILABLE, some interfaces, such as jsdIScript, cache important information so that the wrapper isn't utterly useless once it has been invalidated.  The boolean isValid attribute can be used to see if the wrapper is still valid.

factor debug object counters into some simple macros
add new velid assertion macros for the new ephemeral objects
add utility functions for dealing with PR_CLISTs full of ephemeral objects.
invalidate the jsdIFrame after the execution hook completes
move some c/dtors from jsd_xpc.h over here to avoid exposing debug object counters, and repeating some macros
fix incorrectly set out parameter in getValue::GetDoubleValue
2001-07-03 22:19:04 +00:00
nboyd%atg.com 61f8164eba Fix following bug:
Subject:
             Re: Rhino: [[DefaultValue]] missing for Call object
 Resent-Date:
             Mon, 2 Jul 2001 08:52:07 -0700 (PDT)
 Resent-From:
             mozilla-jseng@mozilla.org
        Date:
             Mon, 02 Jul 2001 11:49:59 -0400
        From:
             Norris Boyd <nboyd@atg.com>
 Organization:
             Art Technology Group
          To:
             Christopher Oliver <coliver@mminternet.com>
         CC:
             mozilla-jseng@mozilla.org
  References:
             1




I believe the correct result of the script should be

[object global]
[object Object]
[object global]

The activation object (which goes by the name of "Call" for historical
reasons) should never be the 'this' value in a function call. See "10.1.6
Activation Object" in the ECMA spec.

I'll look at fixing the problem for Rhino. If there's agreement on my
analysis, someone should fix this for Spidermonkey too.

--N

Christopher Oliver wrote:

> Hi,
>
> function a() {
>     function b() {
>          print(this);
>     }
>     this.f = function() {
>          print(this);
>          b();
>     }
>     b();
> }
>
> var a = new a();
> a.f();
>
> Running the above script with SpiderMonkey produces:
>
> [object global]
> [object Object]
> [object Call]
>
> Running with Rhino produces the following exception:
>
> uncaught JavaScript exception: undefined: Cannot find default value for
> object. (line 3)
>
> This is due to a bug in org.mozilla.javascript.NativeCall which doesn't
> implement toString or valueOf or override getDefaultValue.
> However, even after I hacked in an implementation of getDefaultValue in
> NativeCall, Rhino still produces a different result then spidermonkey:
>
> [object Call]
> [object Object]
> [object Call]
2001-07-03 02:19:51 +00:00
pschwartau%netscape.com 65130fd171 Improving readability. 2001-07-03 01:13:23 +00:00
pschwartau%netscape.com a9e33f26e5 Fixing bug that prevented -p option from working on the Mac. 2001-07-03 00:40:46 +00:00
pschwartau%netscape.com a889741b9e Initial add. 2001-07-02 20:43:49 +00:00
nboyd%atg.com 079d7bea96 Subject:
Re: Bug in RhinoTip
 Resent-Date:
             Sat, 30 Jun 2001 11:45:38 -0700 (PDT)
 Resent-From:
             mozilla-jseng@mozilla.org
        Date:
             Sat, 30 Jun 2001 20:54:21 +0200
        From:
             Igor Bukanov <igor@icesoft.no>
 Organization:
             Wind River
          To:
             nboyd@atg.com
         CC:
             Christopher Oliver <coliver@mminternet.com>, mozilla-jseng@mozilla.org
  References:
             1




Christopher Oliver wrote:

> Hi,
>
> I noticed the following in today's rhinoTip:
>
> js> throw 100
> js: uncaught JavaScript exception: java.lang.Object@5d601f
>
> js> throw 200
> js: uncaught JavaScript exception: java.lang.Object@5d601f
>
> js> throw i = 100
> js: uncaught JavaScript exception: 100



The attached patch to omj/Interpreter.java fixes that: I forgot to check
for stack[stackTop] == DBL_MARK during throw when implemented
interpreter optimization to minimize number of created Double instances.

I think that example should go to the test suite in a form like:
try { throw 100; } catch (ex) { return ex == 100; }

Regards, Igor
2001-07-02 14:00:00 +00:00
nboyd%atg.com 9a8d2c2e41 In case of exceptions creating optimizer, just use interpreter. 2001-07-02 13:59:09 +00:00
nboyd%atg.com 99d9b052fd More liberal rules for default value conversions for java objects. 2001-07-02 13:58:17 +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 ddaaaa90cc Updates from Christopher Oliver. 2001-07-02 13:50:23 +00:00
cls%seawood.org b0724d0103 Link mozjs before nspr for static irix build.
Thanks to John Mark Vandenberg <johnv@adacel.com.au> for the patch.
Bug #88288 r=cls
2001-07-01 15:02:27 +00:00
cls%seawood.org 66d937045b Landing static build changes for OS2
Thanks to Javier Pedemonte <pedemont@us.ibm.com> for the patch.
Bug #85283 r=mkaply r=waterson
2001-07-01 12:11:13 +00:00
jaggernaut%netscape.com 5a6317b8a5 Bug 88413: Remove |GetUnicode()| from nsString (and replace it with |get()|). r=dbaron, rs=scc.
This removes all call-sites I can currently fix. Tomorrow I'll try to get someone to checkin my changes to security/ and I'll get some help with the Netscape side of things.

nsString::GetUnicode()'s final death-blow will be dealt soon. Please keep this in mind as you add new code :-)
2001-06-30 11:02:25 +00:00
pavel%gingerall.cz 9df1ab2d5c JS.pm works correctly 2001-06-29 10:59:32 +00:00
rginda%netscape.com 0e1ad7ad4e use file:// url as the filename, instead of the native path, when compiling js components.
for bug 85968.  r=dbradley, sr=shaver
2001-06-29 02:20:48 +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
rginda%netscape.com 6a25bb3258 - not built -
Add isValid to jsdIScript
Add jsdIService::isOn
2001-06-28 07:47:22 +00:00
rginda%netscape.com 19f9333338 - not built -
declare and initialize new provate members in jsdScript, copy important script properties at jsdScript creation time, so they're around after Invalidate().
2001-06-28 07:47:04 +00:00
rginda%netscape.com f40fe785c4 - not built -
large changes to fix the following bugs:
82684, crash manually clearing breakpoint
*actually* clearing mValid in jsdScript::Invalidate fixed this one.

85636, assertions on quiting venkman
jsdService::Off now disconnects the hooks into JSD, to avoid calling back into js after that.  It also processes any pending script delete events that occurred during the last GC. The code to process the gPendingScripts list has been factored out of the gc callback.  Processing the dead script list allows us to properly finalize all of the jsdIScript object, which seems to clear up the "gc roots exist at shutdown" assertions.  In effect, these changes get rid of *all* of the jsd related assertions on exit.

Added isOn attribute to jsdIService.
Added isValid attribute to jsdIScript.  We now prefetch appropriate properties from the underlying JSDScript, so that it's available after the script is Invalidate()d

moved jsdService constructor to jsd_xpc.h

Save the runtime passed to OnForRuntime so we can use it to clear the GC Gallback in Off().
2001-06-28 07:46:36 +00:00
pschwartau%netscape.com 9c7a5c99bf Fixing bug that prevented -p option from working (user-specified path to test directory) 2001-06-25 21:04:02 +00:00
pschwartau%netscape.com b157dbb66e Added more cases to test. Also improved readability. 2001-06-23 19:22:07 +00:00
pschwartau%netscape.com a0bd092d95 Show "$0" for the global match. Also minor changes to improve readability. 2001-06-23 19:21:05 +00:00
pschwartau%netscape.com 872b7a18e4 Minor formatting change - 2001-06-23 00:48:31 +00:00
pschwartau%netscape.com a75120a825 Initial add. Regression test for bug 87231. 2001-06-23 00:42:39 +00:00
pschwartau%netscape.com 5298a496bc Replacing a return with a continue. Further readability improvements. 2001-06-23 00:41:58 +00:00
pschwartau%netscape.com d44f753a83 Added array-length check. Also improved readability; cleaned up whitespace. 2001-06-22 20:12:01 +00:00
waterson%netscape.com b74d6e1c8b Land STATIC_BUILD_20010612_BRANCH, which supports building mozilla with components statically linked into the executable, as well as 'meta modules' that combine components into uber-DLLs. 2001-06-20 20:21:49 +00:00
rginda%netscape.com 12ea62d4af bug 85355, XPCWrappedNative::ToString should sometimes yield '[object Foo]'. patch=dbradley, r=beard+me, sr=jst, a=dbaron.
Make .toString print [object <class>] instead of [object wrapped <classname>] for xpc wrapped objects with scriptable info.
2001-06-20 00:04:36 +00:00
rginda%netscape.com 6dda9ad7d9 bug 83864 "Access to Components.interfaces denied sometimes", patch=jband, r=dbradley+mstoltz, sr=jst, a=blizzard
Allow xpc wrappers to be created by default, relying on security checks to happen at call-time instead.
2001-06-19 23:39:30 +00:00
rginda%netscape.com 5a37561605 bug 85572, "Javascript Error for each message sent"; patch=jband, r=me, sr=vidur, a=asa
xpconnect had been printing it's large "js component threw exception" whenever chatzilla's socket code threw NS_BASE_STREAM_WOULD_BLOCK from it's streamprovider (a non-error nsresult, bah.)  This patch adds the exception to the "suppression list", to quiet the debug message.
2001-06-19 22:53:36 +00:00
nboyd%atg.com 83d7acfbb7 Hi Norris, Simon,
I looked into this somewhat and I noticed the following:

1) There is a bug in Interpreter.java, line 1695. It sets the variable "i" to
the line number of the special call, but overwrites it on line 1699.  It then
passes this value to ScriptRuntime.callSpecial
2) In "generateScriptICode" in Interpreter.java the variable
itsData.itsSourceFile fails to be set to itsSourceFile.  This causes a null
source file name to be passed to handleCompilationDone when "Widget.js" is
compiled.  That is why you
initially see "<stdin>, line 6" when the debugger comes up (the debugger
interprets a null source name as "stdin").  I simply modified it as follows
(this might not be the right thing to do?):

  private InterpretedScript generateScriptICode(Context cx,
                                                  Scriptable scope,
                                                  Node tree,
                                                  Object securityDomain)
    {
        itsSourceFile = (String) tree.getProp(Node.SOURCENAME_PROP);
        itsData.itsSourceFile = itsSourceFile;
        ...

and that corrected the problem.

However there seems to be no way for the debugger to detect that the script
passed to handleCompilationDone() is the argument of an "eval()". So I modifed
NativeGlobal.evalSpecial() to munge the filename to indicate this (by appending
"(eval)" to it).  That way a separate window is created in the debugger to hold
the compiled eval code.  This is probably not be the best way to solve the
problem.

I have attached the files I modified.

Cheers,

Chris

Simon Massey wrote:

> Christopher,
>
> Attached is the code that trips the debugger up. The debugger comes up. You
minimize the console to reveal Widget.js file window. You click 'Go'. The
Widget.js window looses all the code in it and is just replaced by the evaluated
code:
>
>   this.invokedByEval()
>
> The rhino tip I have is rhino15R2pre.zip
>
> I am running it with the command:
>
> start javaw org.mozilla.javascript.tools.debugger.JSDebugger -f Widget.js -f
Main.js
>
> using the JVM:
>
>   java version "1.3.0"
>   Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
>   Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
>
> on Win2k.
>
> Just in case you are wondering why on earth my code wants to do this, it is
because I want to do some introspection. The real Widget invokes all its methods
that have a particular substring in their names:
>
>         for( key in this ){
>                 if( key.indexOf('reflect') == 0 ){
>                         var evalStr = "this."+key+"()";
>                         eval(evalStr);
>                 }
>         }
>
> Thanks for the great code. I have the real Widget stabilized and am happily
using the debugger on my other files.
>
> Thanks again!
>
> Simon Massey
>
2001-06-19 19:27:21 +00:00
cls%seawood.org bf5fb48486 Replaced NO_SHARED_LIB & NO_STATIC_LIB with BUILD_SHARED_LIBS, BUILD_STATIC_LIBS, FORCE_STATIC_LIB & FORCE_SHARED_LIB. Added FORCE_USE_PIC.
Changes allow us to have a finer control over which parts of the tree are built with PIC.  Part of the static build branch landing.
Bug #46775 r=mcafee a=leaf
2001-06-18 22:10:38 +00:00
pschwartau%netscape.com 691e16fb4d Further improvements to readability. 2001-06-17 23:31:11 +00:00
pschwartau%netscape.com 373ea16a0f Improved readability. 2001-06-17 23:12:31 +00:00
pschwartau%netscape.com 1c9b18876e Whitespace cleanup - 2001-06-14 19:53:47 +00:00
pschwartau%netscape.com 5801aec282 Adding another case to the test. 2001-06-14 18:27:06 +00:00
pschwartau%netscape.com 1c13d9e2da Initial add. Regression test for bug 85880 against Rhino. 2001-06-14 18:03:42 +00:00
nboyd%atg.com 114f43ccd6 Replace instances of append("x") with append('x') on StringBuffers,
removing the need for String object instances.
2001-06-14 17:42:44 +00:00
nboyd%atg.com e361382eb3 Mark deprecated. 2001-06-14 17:40:00 +00:00
nboyd%atg.com 2b5795b8f3 Subject:
jsdoc.js - added simple support for methods
   Date:
        Thu, 14 Jun 2001 09:12:26 +0100 (GMT Daylight Time)
   From:
        Simon Massey <simon_massey@hotmail.com>
     To:
        <nboyd@atg.com>






First off let me say thanks a lot for rhino. It is a really excellent piece
of software.

I am writing a large piece of js for making Excel2000 htm interactive on IE
and other browser such as Netscape6. Use a alot of code OO using methods
along the lines of:

  /**
   * Constructor
   */
  function Type(x){
   this.x = x;
  }

  /**
   * Method
   */
  Type.prototype.getX = function(){
   return x;
  }

  var type = new Type('a');
  var a = type.getX();

I have added to jsdoc.js so that finds and documents the method
declarations.

Attached is my modified jsdoc.js and a sample of the html that it generates
for the some of our proprietry :-( "Axel" code.

As an aside have you seen the job that www.blox.com have done on making a
dhtml spreadsheet? Bet they wished they could use exceptions in Netscape4!

Looking forward to the production JSDebugger. The tip version is great. It
does however seem to trash the view that it has of a file when an eval call
is made in that file. Is there a work around or will I have to wait till
the production version?

Thanks Again!

Simon Massey
2001-06-14 17:38:37 +00:00
nboyd%atg.com 374c7af66a Fix bug 85880 2001-06-14 17:37:18 +00:00
jband%netscape.com 8c82e35ad2 fix SunOs bustage with a .get() on AutoMarkingPtr 2001-06-13 02:16:29 +00:00
jband%netscape.com 623c123aab fix bug 59751 and bug 84600. This adds an AutoMarkingPtr scheme to protect partially built objects from gc. Also make sure we don't allow JS object to implement non-scriptable interfaces. r=dbradley sr=brendan a=drivers 2001-06-13 01:22:32 +00:00
Xiaobin.Lu%eng.Sun.com 49d51102b3 Fix for bug 74482, Calling top.window.close does not work
work done by Nikolay and me
r=beard sr=brendan a=asa
2001-06-13 01:04:29 +00:00
Xiaobin.Lu%eng.Sun.com 0c12dc94c8 Fix for bug 74482, Calling top.window.close() does not work
Work done by Nikolay and me
r=beard sr=brendan a=asa
2001-06-13 01:03:25 +00:00
nboyd%atg.com c6c8d7500a Names should be final. 2001-06-12 20:35:48 +00:00
nboyd%atg.com bf31ffb5f8 Add archive info 2001-06-11 14:16:18 +00:00
pschwartau%netscape.com 11b72244c8 Allow user-defined exit codes: fixed bug that was preventing this from working. 2001-06-08 22:05:32 +00:00