Commit Graph

3438 Commits

Author SHA1 Message Date
brendan%mozilla.org
e46d5f7fc4 Warning abatement (r=polarbear, sr=lumpy). 2001-05-22 23:25:18 +00:00
nboyd%atg.com
0aa0daf081 This patch renames in IdFunction the methodName field into functionName
and ads getFunctionName method to match NativeFunction.
2001-05-22 12:51:21 +00:00
nboyd%atg.com
a388953fef This patch fixes the bug when global With object was set to With
prototype and not With constructor, makes id for constructor property
visible only in a prototype instance and removes the unused scopeInit
function.
2001-05-22 12:51:02 +00:00
nboyd%atg.com
357263c927 The patch adds new class org.mozilla.javascript.BaseFunction as a base
for classes implementing the Function interface and switch
IdFunction.java to use it. The code in BaseFunction to serve as
Function.prototype is not used yet. The patch modifies NativeCall so it
can be used against BaseFunction.

The patch was made from org/mozilla directory via
diff -uN javascript.0 javascript > BaseFunction_patch
2001-05-22 12:50:26 +00:00
scc%mozilla.org
ced4be648e ok, but make this local bustage fix into a global one 2001-05-22 08:43:30 +00:00
scc%mozilla.org
63395b4d88 Fixing AIX/BeOS bustage. The statically determined length of the string was |0|, and on these ports, that was erroneously considered a candidate for conversion to a pointer, which made selection of the appropriate constructor for |nsDependentString| ambiguous ... go figure. 2001-05-22 08:02:58 +00:00
scc%mozilla.org
c9eeb0d1ec Fixing AIX/BeOS bustage. The statically determined length of the string was |0|, and on these ports, that was erroneously considered a candidate for conversion to a pointer, which made selection of the appropriate constructor for |nsDependentString| ambiguous ... go figure. 2001-05-22 07:25:25 +00:00
jband%netscape.com
90b7fefa54 - Fix bug 81341. Force creation of a WrappedJS around the JSObject of
aWrappedNative when doing aggregation. r=dradley sr=jst.
- Fix bug 81877. Avoid infinite recursion when reporting threadsafety
error. r=perterv,dradley sr=jst.
- Fix bug 81882. Use JS_AddNamedRootRT in XPCWrappedNative::AddRef to avoid
the unnecessary cost of creating an XPCCallContext in this frequently called
method. r=dbaron,dbradley sr=jst.
2001-05-21 22:45:14 +00:00
nboyd%atg.com
e4294421c9 This patch changes NativeError.java to store message and name properties
in fields of the object itself instead of using the standard property
hashtable in ScriptableObject.java. This saves 3 object instances per
NativeError (2 slot entries and hashtable array itself) and given the
fact that NativeGlobal defines a few permanent Error instances, it is
visible saving even after taking into account code size increase.

The change also gives a good test of IdScriptable implementation.

-----

This patch introduces the uniform decompile method for NativeFunction
and IdFunction with the signature:

public String decompile(Context cx, int indent, boolean justbody)

instead of NativeFunction.decompile(int indent, boolean toplevel,
boolean justbody) and IdScriptable.toStringForScript(Context cx) and
replaces the special treatment of NativeJavaMethod in
NativeFunction.jsFunction_toString by overriding decompile in
NativeJavaMethod

-----

This patch adds getFunctionName to NativeFunction to return function
name and replaces few places with jsGet_name usage by getFunctionName

The patch was made via
diff -ru javascript.0 javascript > name_patch
from org/mozilla directory
2001-05-21 15:04:54 +00:00
rginda%netscape.com
8a96b5310f - not built -
add enumerateScripts() method to jsdIDebugger service
don't create a new debugger context if the user trys to call on[ForRuntime]() multiple times
2001-05-21 07:18:10 +00:00
rginda%netscape.com
faa84321f8 - not built -
add onForRuntime() method to jsdIDebuggerService to let native code turn on the deubgger (on() can only be called from js)
register an app-start observer so we can turn on the debugger at startup if "js.debugger.autostart" pref is true.
r=peterv, bug 81840
2001-05-21 06:00:12 +00:00
nboyd%atg.com
35caf7c2bb Subject:
Rhino: behavior update for IdScriptable subclasses
        Date:
             Fri, 18 May 2001 11:45:00 +0200
       From:
             Igor Bukanov <igor.bukanov@windriver.com>
 Organization:
             Wind River
         To:
             Norris Boyd <nboyd@atg.com>




The attached patch introduces separation between id-base properties in
prototype instances and the rest of objects so it is possible to
allocate some ids for each instance and the rest only for prototype. The
patch adds to each descendants of IdScriptable a special prototypeFlag
which set to true only if object serves as a global prototype and all
methods that check/return ids first check for that flag. (This is the
reason for the patch size: diff is not very well in dealing with
indentation changes.)

In this way ids for prototype properties are completely hidden from
potential subclasses and there is no need to define methods like
getMaximumId in most cases, only if some ids present in each instance,
IdScriptable.maxInstanceId should be overridden to return max id present
in each instance.

The patch also replaces 2 boolean fields in IdScriptable by bit masks in
the setupFlag field.
2001-05-19 17:39:50 +00:00
jst%netscape.com
77aeecc056 scc checking in from jst's account. bug #75220: sr=jst, rs=brendan. renaming |nsPromiseC?Concatenation| to |nsDependentC?Concatenation|; |nsPromiseC?Substring| to |nsDependentC?Substring|; |nsLiteralC?String| and |nsLocalC?String| to |nsDependentC?String|, as these new names better reflect clients obligations to instances. 2001-05-19 11:27:30 +00:00
jband%netscape.com
a698fad77c fix bug 49017. This extends our mapping of idl [function] interfaces so that they will try to treat the JSObject as a callable function (as before), but if the JSObject is *not* a function object then xpconnect will fall back to the non-[function] behaviour of trying to lookup a named function on the JSObject and then call that. r=jst sr=brendan,vidur,jst,(and everyone else I guess) 2001-05-18 23:35:03 +00:00
jband%netscape.com
040526f65b fix bug 81542. Reorder interface methods so that they do not break compatibility with previously deployed plugins that work with previous versions of our software. The error was that I moved some around at all rather than just adding them to the end of the interfaces! Also, I added back in one method and marked it deprecated. r=dbradley sr=jst 2001-05-18 23:30:28 +00:00
jband%netscape.com
15b0e60bb7 fix bug 81436. Some Solaris compilers screwup symbol resolution if there is a file scope var that is also declared as extern. So we'll just make it not declare these two static (thses are not names that is going to conflict with anything!) r=timeless rs=jband 2001-05-18 23:24:19 +00:00
pschwartau%netscape.com
d52ddf6b10 Improve code by using the apply method of Object.prototype.toString. 2001-05-18 23:20:25 +00:00
nboyd%atg.com
81543cd446 Fix problem in the following mail:
Subject:
             Embedding Rhino in an Applet
 Resent-Date:
             Thu, 17 May 2001 14:53:05 -0700 (PDT)
 Resent-From:
             mozilla-jseng@mozilla.org
        Date:
             Thu, 17 May 2001 16:39:14 -0700
        From:
             "Chester Kustarz II" <chester@monkey.org>
 Organization:
             monkey.org
          To:
             mozilla-jseng@mozilla.org
  Newsgroups:
             netscape.public.mozilla.jseng




Hello, I am trying to find a scripting language with an interpreter that I
can embed in an applet in order to run test scripts inside the applet. I
have already tried TCL-based Jacl and they do not support running inside an
applet. I then downloaded the Rhino/JS interpreter but am having trouble
getting it to run inside the browser (IE 5.5). Here is the exception I am
getting:

com.ms.security.SecurityExceptionEx[org/mozilla/javascript/ScriptRuntime.<cl
init>]: Reflective access to class java.lang.Thread prohibited.
 at com/ms/security/permissions/ReflectionPermission.check
 at com/ms/security/PolicyEngine.deepCheck
 at com/ms/security/PolicyEngine.checkPermission
 at com/ms/security/StandardSecurityManager.chk
 at com/ms/security/StandardSecurityManager.checkMemberAccess
 at java/lang/Class.checkMemberAccess
 at java/lang/Class.getDeclaredMethod
 at org/mozilla/javascript/ScriptRuntime.<clinit>
 at org/mozilla/javascript/ScriptableObject.getExclusionList
 at org/mozilla/javascript/ScriptableObject.defineClass
 at org/mozilla/javascript/Context.initStandardObjects
 at org/mozilla/javascript/Context.initStandardObjects
 at RhinoShellApplet.init
 at com/ms/applet/AppletPanel.securedCall0
 at com/ms/applet/AppletPanel.securedCall
 at com/ms/applet/AppletPanel.processSentEvent
 at com/ms/applet/AppletPanel.processSentEvent
 at com/ms/applet/AppletPanel.run
 at java/lang/Thread.run
com.ms.security.SecurityExceptionEx[org/mozilla/javascript/Context.initStand
ardObjects]: Unable to access system property:
org.mozilla.javascript.JavaAdapter
 at com/ms/security/permissions/PropertyPermission.check
 at com/ms/security/PolicyEngine.shallowCheck
 at com/ms/security/PolicyEngine.checkCallersPermission
 at com/ms/security/StandardSecurityManager.chk
 at com/ms/security/StandardSecurityManager.checkPropertyAccess
 at java/lang/System.getProperty
 at org/mozilla/javascript/Context.initStandardObjects
 at org/mozilla/javascript/Context.initStandardObjects
 at RhinoShellApplet.init
 at com/ms/applet/AppletPanel.securedCall0
 at com/ms/applet/AppletPanel.securedCall
 at com/ms/applet/AppletPanel.processSentEvent
 at com/ms/applet/AppletPanel.processSentEvent
 at com/ms/applet/AppletPanel.run
 at java/lang/Thread.run
2001-05-18 15:31:49 +00:00
rogerl%netscape.com
0569433dd3 Fix bug #76054. sr=brendan, r=beard. Generate lower case tags for all the
string tagify'ing helper functions like 'big()' etc. to be XHTML compliant.
2001-05-17 21:37:33 +00:00
nboyd%atg.com
26ebaa0c66 Fix bug 80322. 2001-05-17 19:02:55 +00:00
pschwartau%netscape.com
33c326091d Skipping two new tests with large switch statements. See bug 81086. 2001-05-17 18:52:43 +00:00
nboyd%atg.com
f269df764c Mail gateway info. 2001-05-17 18:36:59 +00:00
jband%netscape.com
c787e7883d fix bug 81117. allow unsecure access to creating xpconnect wrappers around nsXPCException objects and expose the 'code' property. This saves us from cryptic errors in the JSConsole and DOMExceptions that don't work. r=mstoltz sr=jst 2001-05-17 18:25:06 +00:00
nboyd%atg.com
9214262d1e Just remove commented-out "final". 2001-05-17 17:29:19 +00:00
beard%netscape.com
931e7db74c bug #77856, r/sr=brendan. 2001-05-17 05:45:51 +00:00
beard%netscape.com
342ec29546 bug #77247, r/sr=brendan 2001-05-17 05:42:18 +00:00
vidur%netscape.com
9cbca7b906 Reverting bogus assert. r/sr=brendan,jband 2001-05-17 04:55:49 +00:00
brendan%mozilla.org
a10d5eb5aa Unified resolve recursion damping (70358) and resolve-from-js_SetProperty (72354), r/sr=jband,jst,shaver. 2001-05-17 01:43:58 +00:00
brendan%mozilla.org
768db649d4 STORE_NUMBER's final param must be a jsdouble; fix INTEGER_OPs (81245, r=rogerl, sr=jband). 2001-05-17 01:40:32 +00:00
pschwartau%netscape.com
2f26b642b4 Whitespace cleanup. 2001-05-16 22:45:11 +00:00
brendan%mozilla.org
69dc0b2e55 Fix ChangeTable and how it's called (74883, r=gordon, sr=waterson, mcafee approved). 2001-05-16 21:41:52 +00:00
pschwartau%netscape.com
5c77296fee Initial add. Regression test for bug 76054 in SpiderMonkey and bug 78706 in Rhino. 2001-05-16 19:01:42 +00:00
nboyd%atg.com
e4c32e2c7b Fix bug 78706 2001-05-16 14:07:00 +00:00
Xiaobin.Lu%eng.Sun.com
f56cbe2af5 r=timeless sr=shaver
bug 72807 "c++ style comment warning"
2001-05-16 02:24:44 +00:00
beard%netscape.com
57509c3b22 Removed:
ScopeInitializer.java
2001-05-16 01:10:19 +00:00
nboyd%atg.com
937f24e4f6 2 additional issues:
1. In that patch I forgot to remove "import org.mozilla.classfile.*" and
simply catch Exception in newInvokerMaster which is not a good practice.
The attached patch FunctionObject_patch fixes that and removes other
unused imports.

2. In org.mozilla.classfile.DefiningClassLoader defineClass method first
tries to call via ClassManager the defineClass method in a class loader
that loaded DefiningClassLoader itself. But this would define new
classes in that class loader so they would not be subject of the garbage
collection until a classloader that loads DefiningClassLoader would go
away even if a DefiningClassLoader instance is gone. The
DefiningClassLoader_patch removes that and simply calls super.defineClass.

The patch also change the order of class search in loadClass so the
loader first looks for a class among its defined classes and only after
that in parent loaders.

Regards, Igor
2001-05-16 00:24:37 +00:00
pschwartau%netscape.com
8cd2f18bd6 Initial add. Regression test for bug 74474. 2001-05-15 22:01:39 +00:00
pschwartau%netscape.com
6f0798186c Renaming this file as regress-74474-001.js 2001-05-15 22:00:42 +00:00
brendan%mozilla.org
38fa3fed08 Add optional JSDHashTableOps.initEntry hook, spruce up comments (74883, r=waterson, sr=shaver). 2001-05-15 21:07:10 +00:00
sfraser%netscape.com
55b0ea662e Testing, NOT PART OF ANYTHING 2001-05-15 20:57:01 +00:00
rginda%netscape.com
067d9585e8 bug 76050, use the same module name across the module. Fix senna bustage. r=cls 2001-05-15 20:40:43 +00:00
rginda%netscape.com
9950211597 bug 76050, fix REQUIRES for jsd unix makefile. r=cls 2001-05-15 20:39:35 +00:00
rginda%netscape.com
0bcd7aac66 bug 76050, build js/jsd from toplevel makefile so we're sure we've got an xpidl compiler. r=cls 2001-05-15 20:38:26 +00:00
brendan%mozilla.org
1f8f87f711 Re-init pinned atoms after 1=>0=>1 contexts-in-runtime transition (80619, sr=jband&shaver). 2001-05-15 19:39:16 +00:00
jband%netscape.com
d1b40ba84e remove commented out code 2001-05-15 19:15:30 +00:00
nboyd%atg.com
f7417f7060 2 additional issues:
1. In that patch I forgot to remove "import org.mozilla.classfile.*" and
simply catch Exception in newInvokerMaster which is not a good practice.
The attached patch FunctionObject_patch fixes that and removes other
unused imports.

2. In org.mozilla.classfile.DefiningClassLoader defineClass method first
tries to call via ClassManager the defineClass method in a class loader
that loaded DefiningClassLoader itself. But this would define new
classes in that class loader so they would not be subject of the garbage
collection until a classloader that loads DefiningClassLoader would go
away even if a DefiningClassLoader instance is gone. The
DefiningClassLoader_patch removes that and simply calls super.defineClass.

The patch also change the order of class search in loadClass so the
loader first looks for a class among its defined classes and only after
that in parent loaders.

Regards, Igor
2001-05-15 16:58:08 +00:00
beard%netscape.com
389c07ab3f Removed: src/org/mozilla/javascript/optimizer/JavaScriptClassLoader.java Added: src/org/mozilla/javascript/optimizer/InvokerImpl.java src/org/mozilla/classfile/DefiningClassLoader.java 2001-05-15 15:41:44 +00:00
nboyd%atg.com
1f98cf7a77 New file, mostly moved from org.mozilla.javascript.optimizer.JavaScriptClassLoader 2001-05-15 13:12:43 +00:00
nboyd%atg.com
0068a15b8a Norris Boyd wrote:
> Igor Bukanov wrote:
>
>
>>Norris Boyd wrote:
>>
>>
>>>The intention was to keep classfile and JavaAdapter optional. Those
>>>dependencies crept in. We can use Invoker optionally--perhaps I should do
>>>some performance numbers to see if it's worth it.
>>>
>>I implemented that patch, it splits Invoker.java into Invoker.java and
>>its implementation in optimizer/InvokerImpl.java The reason to put it
>>into optimizer package is that Invoker is very similar in spirit to
>>NativeScript: it generates classes to speed up access and in this way
>>there is no need to have separated option not to use: one can simply
>>remove optimizer all together.
>>
>
> Yes, that sounds great.
>
>
>>
>>I noticed during implementation that JavaAdapter.DefiningClassLoader and
>>optimizer/JavaScriptClassLoader contains the same code, so maybe they
>>can be moved to org.mozilla.classfile package under one name?
>>
>
> Yes, that sounds like a good change too. Thanks for noticing that.


The update is pretty messy: it touches FunctionObject which I changed to
remove the special treatment of NativeWith in the previous patch, and it
also add/removes files.

Here is a description:
DefiningClassLoader.java should go to org/mozilla/classfile. It is the
same code that was in omj/optimizer/JavaScriptClassLoader.java with
class rename and adding public attribute and correspondingly
omj.optimizer/JavaScriptClassLoader.java should be removed. I guess it
would be nice to preserve logs/history in CVS during the move.

InvokerImpl.java should go to omj/optimizer. It is mostly what
omj.Invoker was.

invoker_changes_patch was generated via
cvs diff -u Invoker.java JavaAdapter.java optimizer/Codegen.java
and contains changes against the current CVS

FunctionObject_invoker_patch was generated via
diff -u ../../mozilla.1/javascript/FunctionObject.java FunctionObject.java
and contains changes against that With patch.

Igor
2001-05-15 13:10:38 +00:00
rginda%netscape.com
b5b65abbac fix to help senna tinderbox find PRClist 2001-05-15 07:55:34 +00:00