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

2651 Коммитов

Автор SHA1 Сообщение Дата
rogerl%netscape.com 68724857b9 r=brendan@mozilla.org, Fix for #31255, support '-->' on line by itself as
a line comment - allows old, bogus HTML to execute a la 4.X.
2000-07-10 20:23:54 +00:00
rogerl%netscape.com abddb6b6be r=brendan@mozilla.org, Fix for #44013 - enforce security for defineGetter
& defineSetter by calling OBJ_CHECK_ACCESS.
2000-07-10 20:21:38 +00:00
brendan%mozilla.org 7acd9814b4 Fix an out-of-date comment. 2000-07-08 02:35:56 +00:00
brendan%mozilla.org 58ffa1e2e0 Make it safe to nest a GC from js_AllocGCThing, ultimately from the interpreter; also make sure we collect all garbage (even garbage created by finalizers who unroot or unlock GC-things) when destroying the last context (39125, 44376, r=mccabe@netscape.com). 2000-07-08 02:06:01 +00:00
rogerl%netscape.com daba9186aa Support for 'constructor'. 2000-07-08 01:08:29 +00:00
nboyd%atg.com 0a9b985a17 Deprecate FlattenedObject. 2000-07-07 14:41:35 +00:00
waterson%netscape.com c1a0e63f75 Brendan meant to add jsdhash.h to the Mac build, too. 2000-07-06 20:55:23 +00:00
waterson%netscape.com 1001bcd519 Brendan meant add jsdhash.c to the Mac build, too. 2000-07-06 20:54:17 +00:00
rogerl%netscape.com 1375151969 Removed preprocess step, consolidated identifier handling. 2000-07-06 18:26:26 +00:00
brendan%mozilla.org b117e30fa4 Fix lying comment, pick control flow nit (r=lumpy,a=jack). 2000-07-06 07:38:11 +00:00
brendan%mozilla.org 6d7ae73603 Add jsdhash.h to export/install lists, and jsdhash.c/.obj. 2000-07-06 04:46:18 +00:00
brendan%mozilla.org 2ecb3888a2 Avoid 80th column violations and unnecessary local variable. 2000-07-06 01:15:08 +00:00
brendan%mozilla.org e5ca3a7b1a Undo teeny optimization from rev 3.28, alas it breaks ECMA Ed. 3, 15.5.4.15. 2000-07-06 00:30:46 +00:00
nboyd%atg.com a1f493ab08 Remove obsolete references to NodeFactory. 2000-07-05 17:08:26 +00:00
nboyd%atg.com fdeea4b93b Subject:
Re: Rhino1.5.R1: problems with multithreaded embedded application.
        Date:
             Mon, 03 Jul 2000 14:38:56 -0400
       From:
             Norris Boyd <nboyd@atg.com>
 Organization:
             Art Technology Group
         To:
             Fergus Gallagher <Fergus.Gallagher@orbisuk.com>
 Newsgroups:
             netscape.public.mozilla.jseng
  References:
             1




You found a bug in Rhino; I wonder if others have been running into the same thing.

The problem is with a class called LazilyLoadedCtor. I wrote this class to reduce the
time
required by initStandardObjects by only creating standard objects when the associated
constructors are first accessed. The problem is that this class was not threadsafe.
I've
made changes to that class, and to ScriptableObject as well. The design of dynamic
properties calling getters and setters (which LazilyLoadedCtor uses) didn't really
allow
any way for the getter/setter to replace itself without a thread hazard. I've now
extended
setters so that they can return a value which replaces the getter/setter to avoid this
problem.

Thanks for finding this problem. There have been a couple of other reports of problems
in
this area, so I hope this will fix them.

The patch follows.

--N

Index: LazilyLoadedCtor.java
===================================================================
RCS file: /cvsroot/mozilla/js/rhino/org/mozilla/javascript/LazilyLoadedCtor.java,v
retrieving revision 1.1
diff -u -r1.1 LazilyLoadedCtor.java
--- LazilyLoadedCtor.java 2000/02/29 21:34:37 1.1
+++ LazilyLoadedCtor.java 2000/07/03 18:31:03
@@ -58,9 +58,12 @@
     }

     public Object getProperty(ScriptableObject obj) {
-        obj.delete(ctorName);
         try {
-            ScriptableObject.defineClass(obj, Class.forName(className));
+            synchronized (obj) {
+                if (!isReplaced)
+                    ScriptableObject.defineClass(obj, Class.forName(className));
+                isReplaced = true;
+            }
         }
         catch (ClassNotFoundException e) {
             throw WrappedException.wrapException(e);
@@ -83,11 +86,14 @@
         return obj.get(ctorName, obj);
     }

-    public void setProperty(ScriptableObject obj, Object val) {
-        obj.delete(ctorName);
-        obj.put(ctorName, obj, val);
+    public Object setProperty(ScriptableObject obj, Object val) {
+        synchronized (obj) {
+            isReplaced = true;
+            return val;
+        }
     }

     private String ctorName;
     private String className;
+    private boolean isReplaced;
 }
Index: ScriptableObject.java
===================================================================
RCS file: /cvsroot/mozilla/js/rhino/org/mozilla/javascript/ScriptableObject.java,v
retrieving revision 1.17
diff -u -r1.17 ScriptableObject.java
--- ScriptableObject.java 2000/03/13 17:12:36 1.17
+++ ScriptableObject.java 2000/07/03 18:31:04
@@ -246,11 +246,21 @@
                             break;
                         }
                     }
-                    getterSlot.setter.invoke(start, arg);
+                    Object v = getterSlot.setter.invoke(start, arg);
+                    if (getterSlot.setterReturnsValue) {
+                        slots[slotIndex].value = v;
+                        if (!(v instanceof Method))
+                            slots[slotIndex].flags = 0;
+                    }
                     return;
                 }
                 Object[] args = { this, actualArg };
-                getterSlot.setter.invoke(getterSlot.delegateTo, args);
+                Object v = getterSlot.setter.invoke(getterSlot.delegateTo, args);
+                if (getterSlot.setterReturnsValue) {
+                    slots[slotIndex].value = v;
+                    if (!(v instanceof Method))
+                        slots[slotIndex].flags = 0;
+                }
                 return;
             }
             catch (InvocationTargetException e) {
@@ -1183,6 +1193,7 @@
         slot.delegateTo = delegateTo;
         slot.getter = getter;
         slot.setter = setter;
+        slot.setterReturnsValue = setter != null && setter.getReturnType() !=
Void.TYPE;
         slot.value = null;
         slot.attributes = (short) attributes;
         slot.flags = flags;
@@ -1551,6 +1562,7 @@
     Object delegateTo;  // OPT: merge with "value"
     Method getter;
     Method setter;
+    boolean setterReturnsValue;
 }




Fergus Gallagher wrote:

> I am having problems getting my head around contexts and scopes and my
> multi-threaded application fall over.
>
> If I set "global=false" the following code used a per-thread
> initStandardObject() and this seems to work.  But when I set
> "global=true", the global "parentScope" is used and I get some wierd
> errors.
>
> If I change "__CODE__.slice(0,5)" to
> 1. "__CODE__" - works
> 2. "__CODE__.substring(0,5)" - fails
> 3. "__CODE__.toString()" - works
>
> Any help appreciated.
>
> Fergus
>
> ===== Test.java =========================================
> import java.io.*;
> import org.mozilla.javascript.*;
>
> public class Test implements Runnable {
>         private Script script;
>         private Scriptable parentScope;
>         private String __CODE__="ABCDEFGHIJK";
>         private boolean global = true;
>         private static Context globalContext = null;
>         public Test() throws Exception {
>                 String js= "java.lang.System.out.println(__CODE__.slice(0,5));";
>                 globalContext.setCompileFunctionsWithDynamicScope(false);
>                 parentScope = globalContext.initStandardObjects(null);
>                 StringReader sr = new StringReader(js);
>                 script = globalContext.compileReader(parentScope, sr, "(compiled)",
> 1,null);
>         }
>
>         public void run() {
>                 try {
>                         Context context = Context.enter();
>                         Scriptable threadScope;
>                         if (global) {
>                                 threadScope = context.newObject(parentScope);
>                                 threadScope.setPrototype(parentScope);
>                                 threadScope.setParentScope(null);
>                         } else {
>                                 threadScope = context.initStandardObjects(null);
>                         }
>                         threadScope.put("__CODE__",threadScope,__CODE__);
>                         script.exec(context,threadScope);
>                 }
>                 catch (Exception e) {
>                         System.err.println(e.getClass().getName()+":
"+e.getMessage());
>                 }
>                 finally {
>                         Context.exit();
>                 }
>         }
>
>         public static void main(String args[]) throws Exception {
>         globalContext = Context.enter();
>                 Test me = new Test();
>                 int count=10;
>                 Thread[] threads = new Thread[count];
>                 for (int i=0; i<count; i++) {
>                         Thread t = new Thread(me);
>                         threads[i] = t;
>                         t.start();
>                 }
>                 for (int i=0; i<count; i++) {
>                         threads[i].join();
>                 }
>                 Context.exit();
>         }
> }
>
> ==== OUTPUT ===============================================
> ABCDE
> ABCDE
> org.mozilla.javascript.EcmaError: undefined is not a function.
> org.mozilla.javascript.EvaluatorException: Constructor for "String" not
> found.
> org.mozilla.javascript.EvaluatorException: Constructor for "String" not
> found.
> org.mozilla.javascript.EvaluatorException: Constructor for "String" not
> found.
> org.mozilla.javascript.EvaluatorException: Constructor for "String" not
> found.
> org.mozilla.javascript.EvaluatorException: Constructor for "String" not
> found.
> org.mozilla.javascript.EvaluatorException: Constructor for "String" not
> found.
> org.mozilla.javascript.EvaluatorException: Constructor for "String" not
> found.
> ===========================================================
>
> The number and type of exceptions is highly variable from run to run -
> anywhere from 1-9 out of 10.
> The EcmaError in particular only happens occasionally.
>
> --
> Fergus Gallagher          Tel: +44 (20) 8 987 0717
> Orbis                     Fax: +44 (20) 8 742 2649
> The Swan Centre           email: Fergus.Gallagher@orbisuk.com
> Fishers Lane              Web: http://www.orbisuk.com
> London W4 1RX / UK
2000-07-03 18:40:35 +00:00
jband%netscape.com 53edf6e9f7 updating readme. Not part of build 2000-07-02 19:37:57 +00:00
cls%seawood.org 1f3b6d75ab Removed obsolete REQUIRES variable from every Makefile.in/makefile.win 2000-06-30 08:08:04 +00:00
jband%netscape.com 1a7630d560 Fix dogfood/crash bugs: 42750, 39858 and fix 43897 and improve JS/XPConnect error reporting to help with crasher 40792. r=mccabe@netscape.com. 2000-06-30 04:04:46 +00:00
beard%netscape.com 0eeae607ae Fix build bustage. 2000-06-29 18:40:58 +00:00
rogerl%netscape.com fd98adafce use handleDot for call, too. 2000-06-29 18:30:47 +00:00
beard%netscape.com 8f5fea173e delete property support. 2000-06-29 18:14:14 +00:00
beard%netscape.com a4c5f704f4 DELETE_PROP 2000-06-29 18:13:46 +00:00
beard%netscape.com 7a6367c583 DELETE_PROP 2000-06-29 17:14:56 +00:00
beard%netscape.com 11134b4173 added DELETE_PROP instruction to implement the "delete" operation. 2000-06-29 17:11:50 +00:00
beard%netscape.com 97dfdc5f04 unused parameter warning 2000-06-29 05:48:09 +00:00
beard%netscape.com 8f4cadb250 complementary operator delete(void*, JSClass*). 2000-06-29 05:46:36 +00:00
beard%netscape.com 8891b0c7ba some classes to test js2 with. 2000-06-29 04:49:48 +00:00
beard%netscape.com 8da0055bc5 updated dependencies 2000-06-29 04:25:10 +00:00
beard%netscape.com 074f981eb4 Changed StaticCall to use static slot. 2000-06-29 04:23:56 +00:00
beard%netscape.com b202adfd39 Fixing static dotted expressions. 2000-06-29 04:23:20 +00:00
beard%netscape.com 7a512866fd now uses conditional compilation #if defined(OPCODE_NAMES), so that a simple "icode.h" can be included by vmtypes.h and vmtypes.cpp. 2000-06-29 04:21:00 +00:00
beard%netscape.com 486b437613 moved all machine generated classes, etc. to icode.h. 2000-06-29 04:19:19 +00:00
beard%netscape.com 2a451cdd8b Generated by tools/gencode.pl. 2000-06-29 04:18:16 +00:00
beard%netscape.com 640ba6e24c fixed static calls. 2000-06-29 03:15:52 +00:00
rogerl%netscape.com 63744d7c1c Implicit this and class lookup stuff. 2000-06-29 01:21:41 +00:00
cls%seawood.org e5efcb7528 wrap ifndef XPCONNECT_STANDALONE around xpconnect test components that require external interfaces. Thanks to Mark Adams <madams@janna.com> for the patch. Bug 42026 2000-06-28 22:53:55 +00:00
beard%netscape.com 237dd352ed implemented JSClass::printProperties(). 2000-06-28 19:46:13 +00:00
beard%netscape.com 9930edd0d5 Enhanced printing of types. 2000-06-28 19:45:44 +00:00
beard%netscape.com c0e9f6d274 Type of a JSType* is Type_Type (wow, recursive). Changed mBaseType to be JSType* instead of const JSType*. 2000-06-28 19:45:09 +00:00
rogerl%netscape.com 52bffdadcf First set of unified 'dot' handling changes for statics. 2000-06-28 18:41:30 +00:00
beard%netscape.com d40b8dd8cb added jsclasses.h 2000-06-28 18:10:04 +00:00
beard%netscape.com 941b505765 Fix string <. 2000-06-28 16:38:20 +00:00
beard%netscape.com d9bf640477 Fixed dynamic lookup of static slots. Added code to compare strings. 2000-06-28 16:32:52 +00:00
beard%netscape.com b1350d87b6 GET_STATIC/SET_STATIC/STATIC_XCR now use an index rather than a name. Implemented GET_PROP/SET_PROP for class objects (looks up slot dynamically, etc.) 2000-06-28 16:15:06 +00:00
beard%netscape.com 866b5d3d8d GET_STATIC/SET_STATIC/STATIC_XCR now use an index rather than a name. Now using JSClass::hasStatic() rather than looking up statics in class' scope. 2000-06-28 16:14:18 +00:00
beard%netscape.com 8132734212 GET_STATIC/SET_STATIC/STATIC_XCR now use an index rather than a name. 2000-06-28 16:13:12 +00:00
beard%netscape.com 970477555f Static slots. 2000-06-28 16:11:54 +00:00
cls%seawood.org a9f6433fbe Tweaks to build xpconnect standalone. Bug #42024. Thanks to Mark Adams <madams@janna.com> for the patches. 2000-06-28 07:03:13 +00:00
beard%netscape.com 2b1351cc3b Win-specific operator== noise. 2000-06-27 03:52:56 +00:00
beard%netscape.com 4873ce7882 Fixed unitialized static class members. 2000-06-27 03:43:40 +00:00
beard%netscape.com 7b2b4a1e2f addSlot -> defineSlot, added defineStatic. 2000-06-27 03:42:42 +00:00
brendan%mozilla.org 9f75641ee2 Not again\! 2000-06-27 03:29:49 +00:00
beard%netscape.com 74e8d0a780 Fixed type management. 2000-06-27 03:21:33 +00:00
brendan%mozilla.org af94bec8f7 Fix my stupid missing comma bustage. 2000-06-27 03:17:47 +00:00
rogerl%netscape.com fbdb3fe1c1 lots of stuff me and Patrick did 2000-06-27 02:39:32 +00:00
brendan%mozilla.org 6afe0ed1a7 Fix JS_SetPrototype and __proto__ setting to deal with shared scopes; use JSObjectOps for setProto and setParent operations, and add spare op slots (41126, r=shaver@mozilla.org,pschwartau@netscape.com). 2000-06-27 02:37:25 +00:00
beard%netscape.com 965f10e915 JSValue::operator==: added CASE(type) to fix warning. 2000-06-26 17:47:07 +00:00
beard%netscape.com f276cc3dfd added JSObject::deleteProperty(), and changed mName in JSType to be a JSString. Need to revisit other uses of String soon. 2000-06-26 17:42:20 +00:00
beard%netscape.com 07dff8c5d1 simplified string addition 2000-06-26 17:25:25 +00:00
beard%netscape.com fef138fae2 defined JSStringBase, and constructors from in JSString 2000-06-26 17:24:57 +00:00
beard%netscape.com 769d11bcbf String addition: don't share structure with LHS. 2000-06-26 17:09:27 +00:00
beard%netscape.com 45301bb589 added constructor from JSString&. 2000-06-26 16:55:01 +00:00
beard%netscape.com 3a78e14938 Reset register usage after generating each initializer statement. 2000-06-26 15:19:45 +00:00
beard%netscape.com 714e109074 Simplified NEW_CLASS, using a single do .. while loop, introducing nextPC instruction iterator to simplify initial case. now calls all defined constructors. 2000-06-26 15:06:36 +00:00
beard%netscape.com 07d6ee2613 Only call non-null constructors. 2000-06-25 17:04:38 +00:00
beard%netscape.com 40e53d46ea Conditionally set constructor, if it has any instructions. 2000-06-25 17:04:01 +00:00
beard%netscape.com 21f549896a updated dependencies 2000-06-25 16:44:29 +00:00
beard%netscape.com d6c6cc31bb check for non-null superClass 2000-06-25 16:43:25 +00:00
beard%netscape.com 5d311184e2 hooked up superClass' scope as the prototype of a class's scope, to do method inheritance, removed bogus JSInstance::getSlotCount(), which overcounted slots. 2000-06-25 16:35:33 +00:00
beard%netscape.com 728580c6f8 Added calls to superClass constructors. 2000-06-24 22:42:43 +00:00
beard%netscape.com e41bd745dd JSInstance::getSlotCount() no longer recursive. 2000-06-24 22:42:15 +00:00
beard%netscape.com 7b76b9503a Beginning support for superclass slots. 2000-06-24 22:07:00 +00:00
beard%netscape.com 36eef7adea Added emptyArgs, removed unused return value in readEvalFile 2000-06-24 05:42:51 +00:00
beard%netscape.com a6493add9f enable RTTI 2000-06-24 05:36:52 +00:00
beard%netscape.com b877fde64f VC++ doesn't like local classes in templates. 2000-06-24 05:36:09 +00:00
beard%netscape.com c5298ced1d major surgery to enable the "load()" native function. 2000-06-24 05:25:33 +00:00
beard%netscape.com 46c0a7c5a8 Experiment with looking up methods in the prototype chain. 2000-06-24 05:22:23 +00:00
beard%netscape.com c337fff76a Always use the target object, regardless of where a method property is found along the prototype chain. 2000-06-24 05:21:49 +00:00
beard%netscape.com 8558f071a4 When generating a reference to "this" use the current code generator's mClass when appropriate. 2000-06-24 05:21:03 +00:00
rginda%netscape.com 486d1cc51a fixing source stepping (opcode stepping to come back later)
debugger is now quiet by default.
2000-06-24 02:53:29 +00:00
beard%netscape.com 27b088f22a Removed JSType::isClassType(). 2000-06-24 02:51:34 +00:00
beard%netscape.com 565b0389db Added JSClass::get/setConstructor(). 2000-06-24 02:51:03 +00:00
beard%netscape.com 9fd0505086 Added call to constructor when executing NEW_CLASS. 2000-06-24 02:50:23 +00:00
beard%netscape.com 47638a00c7 Generating default constructor to run slot initializers. 2000-06-24 02:49:45 +00:00
beard%netscape.com 146e187c7b testCompile() is static 2000-06-24 01:04:58 +00:00
rogerl%netscape.com e497a7809f typing 'this' 2000-06-24 01:02:34 +00:00
rogerl%netscape.com 432c8b3cdc Got newClass working, added printProperties for instances, some slot
stuff is happening.
2000-06-24 00:50:59 +00:00
beard%netscape.com f304229d7f added NEW_CLASS instruction, to instantiate classes. 2000-06-23 23:49:48 +00:00
beard%netscape.com 35b239cd47 added NEW_CLASS instruction. 2000-06-23 23:49:17 +00:00
rogerl%netscape.com e939fbddc4 Adding slot handling to code gen. 2000-06-23 23:43:24 +00:00
beard%netscape.com 841b79b5eb added NEW_CLASS instruction. 2000-06-23 23:41:27 +00:00
beard%netscape.com da108e7b96 Added JSClass::hasSlot, getSlotCount(), and JSInstance. 2000-06-23 23:25:55 +00:00
beard%netscape.com 9f413f408b JSValue::type now JSType* instead of const JSType*, all predefined JSType objects no longer const as well. 2000-06-23 23:25:14 +00:00
rogerl%netscape.com 89515e83dc Removed FUNCTION instruction, other class related junk. 2000-06-23 22:53:09 +00:00
rginda%netscape.com da45d9b0eb Added debugger opcode, change InstructionMap to a std::map, print source lines while tracing 2000-06-23 22:27:17 +00:00
rogerl%netscape.com ea920b48c8 Add return statement if the function doesn't end with one 2000-06-23 21:20:03 +00:00
beard%netscape.com da19218b3e added assertion to ensure that mPC is always valid before fetching the next instruction. 2000-06-23 06:10:14 +00:00
beard%netscape.com 95adc8b187 Additional JSClass processing: defining slots, generating methods. 2000-06-23 05:13:04 +00:00
beard%netscape.com ca9001f387 When using a JSScope that has a parent scope, don't bother defining the standard properties, they will be shared. 2000-06-23 05:10:46 +00:00
beard%netscape.com 6ccb94e600 A JSClass is a JSType now, and has a JSScope. Added addSlot, getSlot, getScope. 2000-06-23 05:09:37 +00:00
beard%netscape.com dee62b8d67 remove unused file. 2000-06-23 04:10:04 +00:00
drapeau%eng.sun.com 7f384b86a6 Two main things:
1) Fix for 23775 (three files changed for this)

2) Many OJI unit tests added.
2000-06-23 02:28:31 +00:00
beard%netscape.com f7c44fcf6f putting the JSClass* in the current global scope, and looking up superclass rereferences. 2000-06-23 02:22:55 +00:00
rogerl%netscape.com 33c9eb064a Added support for 'debugger' as a statement. (Rob made me) 2000-06-23 00:08:10 +00:00
beard%netscape.com 5ee7d6da77 JSClass support. 2000-06-21 23:58:17 +00:00
beard%netscape.com 124280ce07 initial checkin, starting on a representation for JS2 classes. 2000-06-21 23:57:09 +00:00
rogerl%netscape.com f2591282dc Work to support 'this'. 2000-06-21 22:32:21 +00:00
nboyd%atg.com e7359ce462 Fix javadoc warning 2000-06-21 15:49:14 +00:00
rogerl%netscape.com 27e254fee3 Changed use of Register to TypedRegister throughout. 2000-06-20 22:45:45 +00:00
rogerl%netscape.com 8a71a568af Support for TypedRegister 2000-06-20 22:44:46 +00:00
pavel%gingerall.cz f8ce45f144 - workaround of -rdynamic (JS_PERLCONNECT only) 2000-06-16 08:56:03 +00:00
brendan%mozilla.org 5c53e520b1 sfraser@netscape.com's fine GC_MARK_DEBUG enhancement for XPConnect. 2000-06-16 04:34:00 +00:00
rogerl%netscape.com a8a18e9d21 Added tests for scripts as strings. 2000-06-16 01:37:47 +00:00
rogerl%netscape.com ecd0d99e85 Mucking about with operator overlaoding plus initializing global context
- beginning type stuff.
2000-06-16 01:36:59 +00:00
rogerl%netscape.com 670a8310fb Fixed spelling. 2000-06-16 01:35:25 +00:00
rogerl%netscape.com b2f3dff014 Added op= support. 2000-06-15 16:03:54 +00:00
nboyd%atg.com 4242e00f01 Wrapping a class produces a NativeJavaClass. 2000-06-15 14:00:31 +00:00
rogerl%netscape.com c354e43376 Mark top-level execution as 'script' rather than function - to handle
vars correctly.
2000-06-14 23:28:38 +00:00
rogerl%netscape.com 5762b34619 Added 'Function' instruction, plus suppresses class output if there is
no super specified. (ok it's a hack, but it works)
2000-06-14 23:27:28 +00:00
rogerl%netscape.com 6526fedd31 Adding support for Functions and Vars, preXcrement, object literals. 2000-06-14 23:26:15 +00:00
nboyd%atg.com 999f43aaec Fix bug 42097 2000-06-14 13:39:44 +00:00
pavel%gingerall.cz fff3bf7638 - fixes in original version of perlconnect (JSVALToSV SVToJSVAL etc.)
- object delegation (like JSCreateObject) Perl->JS
- ParlValue handles PerlObject correctly
- undef values handled correctly (in both directions)
- JS arrays may be tied to perl arrays
- error handlers supported on Perl side
- no globals
- several minor fixes
2000-06-14 07:23:58 +00:00
pavel%gingerall.cz 0c07208dc5 - minor change of jsperl.h inclusion, matters for perlconnect build only 2000-06-14 07:18:41 +00:00
rginda%netscape.com 2ebc0a5b20 -- NOT PART OF THE BUILD --
Conditionally build lcshell w/ jdk 1.1.8 or 1.2.2 on windows
2000-06-14 00:14:56 +00:00
mkaply%us.ibm.com 737d9fb1b4 # 37239
r = mccabe, a = brendan
OS/2 bring-up - PR_CALLBACK for VisualAge
2000-06-14 00:07:08 +00:00
mccabe%netscape.com 3a709facd8 First part of fix for 38495, support for exposing plugin methods to JavaScript.
This patch teaches XPConnected objects to look in their JavaScript __proto__ chain for any names they can't resolve themselves.  The rest of the fix to this bug sets the original DOM node object as the prototype of a new xpconnect-exposed plugin object, so javascript accesses will see names from both objects.

r=jst,brendan
a=beard
2000-06-13 23:18:21 +00:00
nboyd%atg.com 341e3b8ddf Begin 1.5R2 effort.
Commit the following contributions:
* Andi Vajda's changes to allow embedders to capture the generated bytecode (and thus control
generated class names).
* Marshall Cline's changes to allow embedders to override the default Java object wrapping
behavior
* Kurt Westerfeld's change to handle calling static methods better
2000-06-13 14:33:54 +00:00
scc%mozilla.org 507357239c fix type equivalence between |PRUnichar| and |jschar| now that |PRUnchar| may be |wchar_t| on select platforms 2000-06-12 23:52:31 +00:00
rogerl%netscape.com 0b4dc2b357 Added check for FORMAT characters in new unicode cr/lf handling code. 2000-06-12 17:56:05 +00:00
brendan%mozilla.org d8f3cd1921 Comply with weird ECMA nit: call (o.f)() (note parens around the function expression) must bind 'this' to the global object, not to o\! (41864, r=shaver). 2000-06-08 06:46:18 +00:00
nboyd%atg.com bd67f54d28 Fix formatting. 2000-06-07 14:51:08 +00:00
nboyd%atg.com fc46786bff Fix the following problem:
Subject:
        Odd behaviour on placement of .jar files?!
   Date:
        Mon, 05 Jun 2000 10:46:08 -0700
   From:
        John Raykowski <xski@xski.org>
     To:
        nboyd@atg.com




Hello,

I didn't want to post this directly as a rhino bug 'coz I think it may
be more of a JDK thing, but I thought I'd toss it to you as well.

The goal is to create a JavaScript object that implements a Java
interface. Straightforward enough and the example on the page using
ActionListener works without a hitch.  However, when I try to do the
same with my own interface, I get an error message: error instantiating
({0}): class {1} is interface or abstract (coming from
NativeJavaClass.construct).

Here's where it gets a bit strange.  Normally, I run with the jar files
in jre/lib/ext.  When I remove the rhino files from jre/lib/ext and
reference them explicitly on the commandline with the -cp option, it
works as expected and my script can implement the interface just fine.
Go figure.

Anyhoo, there ya go.  Like I said, I think its a JDK issue, but I
thought you'd be interested.  The attached zipfile contains a set of
sample code to demonstrate this problem.

Thanks heaps,

-jmr
2000-06-07 14:50:47 +00:00
brendan%mozilla.org 73d4167370 Use localizable error message for out of memory. 2000-06-06 04:54:04 +00:00
brendan%mozilla.org 28d3dcb5fc Better fix, really (r=shaver for sure). 2000-06-06 04:41:05 +00:00
brendan%mozilla.org 4e92401f64 Better control flow for catch clause code generation (r=shaver). 2000-06-06 04:27:37 +00:00
mccabe%netscape.com 3b337ab6af Fix to potential leak introduced with fix to 40406.
Be conservative in handling the lifetime of the safe context created by XPConnect to execute JS Components, and save it off to be destroyed at cleanup time, even if some other safe context is registered with XPConnect via SetSafeJSContext.

r=vishy, a=brendan
2000-06-06 00:01:25 +00:00
brendan%mozilla.org 6f0b30ca8f Fix missing $ bug when testing test_dir. 2000-06-03 19:20:03 +00:00
brendan%mozilla.org d2c7c21d1b Avoid zero-length malloc (and assertbotch) in array_sort, just return true early\! 2000-06-03 19:00:28 +00:00
warren%netscape.com 512c8bf433 Renaming nsIAllocator to nsIMemory (and nsAllocator to nsMemory). API cleanup/freeze. Bug #18433 2000-06-03 09:46:12 +00:00
waldemar%netscape.com 2166c80bec Added parsing and printing of classes, interfaces, and namespaces 2000-06-02 04:35:44 +00:00
brendan%mozilla.org 6ca20f928f Fix ECMA DontDelete compliance problems, which create getter/setter security holes (40760, r=shaver). 2000-06-02 00:02:46 +00:00
nboyd%atg.com faea4ed119 Fix "in" operator for compiled mode. 2000-06-01 23:40:29 +00:00
nboyd%atg.com 4d4458bd63 Add column number and line source information to the EcmaError object. 2000-06-01 17:30:28 +00:00
mkaply%us.ibm.com 716fff7b7c # 40177
r = leaf, a = brendan
Fix tab in makefile
2000-06-01 14:15:39 +00:00
waldemar%netscape.com 767f3c1669 Widened default line width to 30 2000-06-01 03:31:17 +00:00
waldemar%netscape.com 5c440a5bc5 Added function and constructor parsing and printing; fixed printing of blocks, compound statements, and :: 2000-06-01 03:30:58 +00:00
waldemar%netscape.com ebbccfd9f8 Added two-argument linearBreak 2000-06-01 03:30:19 +00:00
brendan%mozilla.org aca040859b Use JS_ValueToId to go from user to internal property id, for integer-id optimality (40731, r=shaver). 2000-05-31 22:10:53 +00:00
brendan%mozilla.org d84057e951 Make JS_ExecuteScriptPart call the debugger hooks (41066, r=MyNGs@HotMail.com). 2000-05-31 21:57:46 +00:00
nboyd%atg.com 4a72992ae8 check for null scope 2000-05-30 21:50:44 +00:00
nboyd%atg.com 9cc29b7e22 Fix bug 40844 2000-05-29 16:57:13 +00:00
nboyd%atg.com a50280a77b Fix bug 39906 2000-05-28 19:01:24 +00:00
nboyd%atg.com dc7deebcad Remove tests obsoleted by the change that access to nonexistent properties of Java objects
returns undefined rather than causing an error
2000-05-28 18:50:58 +00:00
nboyd%atg.com d092952991 for Java methods, print the signatures of the overloaded methods in a comment when
the JavaScript function wrapper's toString method is called
2000-05-28 04:25:07 +00:00
brendan%mozilla.org 6a220f2f41 Fix unreviewed changes made to fix 'Uninitialized variable compiler warnings'. 2000-05-28 00:02:26 +00:00
jst%netscape.com 60b53dbf6e Fixing bustage on solaris native builds. reported and reviewed by Tomi.Leppikangas@oulu.fi 2000-05-27 13:14:31 +00:00
edburns%acm.org 67cfd5f36b r=brendan
a=brendan
bug: 27362

This fix makes it so nsCLiveconnect.cpp doesn't #include
files within an extern "C" {} block.  To make this work, I
simply moved the extern "C" {} to the minimum necessary
range.  This required placing an "ifdef __cplusplus extern "C""
block in jsj_private.h, since nsCLiveconnect.cpp is the only
c++ file that includes jsj_private.h.
2000-05-27 01:12:40 +00:00
rogerl%netscape.com 4e3dcc082c Removed old branches, changed offset printing to handle NULL operand. 2000-05-26 22:35:36 +00:00
rogerl%netscape.com 565b842243 Update to new icg constructor etc. 2000-05-26 22:34:42 +00:00
rogerl%netscape.com 573531b249 Statement fun 2000-05-26 22:33:05 +00:00
waldemar%netscape.com bd3b79569c Added var, const, and for statements 2000-05-26 06:20:11 +00:00
shaver%mozilla.org 634ad644e4 use NS_METHOD for register/unregister callback, for Win32 2000-05-26 05:55:00 +00:00
shaver%mozilla.org 12fe3f7799 fix build bustage -- I'm an ass 2000-05-26 05:18:31 +00:00
shaver%mozilla.org ee8d2a82fe remove useless nsIModule paste (#22922), add debug() for JS components, use categories for component loaders, XPCONNECT_STANDALONE (#39875), r=dp,waterson a=brendan 2000-05-26 04:56:23 +00:00
mkaply%us.ibm.com 367ea5b7df # 34106
r = leaf, a = brendan
Mistake was made with an earlier makefile checkin - removing double definition of EXTRA_DSO_OPTS
2000-05-25 14:25:04 +00:00
mccabe%netscape.com b05da32465 Fix the fix to 40406, fixing bustage.
Don't destroy the per-thread safe JS context on cleanup if that context was provided through the setter.

r=waterson
2000-05-25 08:33:53 +00:00
mccabe%netscape.com ba80f85fb1 Fix for 40406. Add setter to XPConnect to set default JS context used to execute JS components when no appropriate context can be found.
The setter changes per-thread data - for the DOM/UI thread, this means that we can set the JS Context to one with DOM magic.  This magic allows some DOM JS <-> XPConnect JS conversions to succeed, and in particular allows creation of a DOM window from within a JS component.

Unblocks nsbeta2 work by Vishy and Pavlov.

r=mccabe,vishy.  a=brendan,sleestack.
2000-05-24 22:54:57 +00:00
nboyd%atg.com a7fc06c9a3 Add rhino9 and rhinoms9. 2000-05-24 18:10:55 +00:00
waldemar%netscape.com cec8a6816d Fixed case/default indenting 2000-05-24 02:18:57 +00:00
rogerl%netscape.com 39ebb9c8d8 Codegen for statements. Blew off old statement API and most of the test
functions for now, sorry.
2000-05-24 02:11:39 +00:00
waldemar%netscape.com d4e4f10d14 Turned on statement parsing and printing 2000-05-24 01:51:32 +00:00
waldemar%netscape.com c970639ae9 Added statement parsing 2000-05-24 01:51:20 +00:00
waldemar%netscape.com fe6fac7c85 Added using std::fmod declaration 2000-05-24 00:55:23 +00:00
waldemar%netscape.com 389625522b Fixed Mac warning 2000-05-24 00:54:56 +00:00
waldemar%netscape.com bdd3276507 Fixed Mac warnings 2000-05-24 00:54:40 +00:00
waldemar%netscape.com 0765893319 Fixed syntax errors: can't use qualified names in class definitions, and 'not' is a C++ reserved word 2000-05-24 00:54:28 +00:00
nboyd%atg.com 0074ca5edf Remove unused constructor. 2000-05-23 21:03:50 +00:00
nboyd%atg.com 108f81d6ac Fix up bug where direct calls were getting the parent scope when they shouldn't have,
resulting in a NullPointerException on the following code when run on the MS VM with -opt 9:

var testcases = getTestCases();

function getTestCases() {
    return new Boolean(new MyObject(true));
}

function MyObject( value ) {
    this.value = value;
    this.valueOf = new Function( "return this.value" );
    return this;
}
2000-05-23 20:59:13 +00:00
rginda%netscape.com b71c85c7dc apparently windows is too 2000-05-23 00:15:06 +00:00
rginda%netscape.com 27345b3bb3 linux is so picky 2000-05-23 00:13:48 +00:00
rogerl%netscape.com 709d6c75d9 COMPARE_GT etc are gone. 2000-05-23 00:09:44 +00:00
rogerl%netscape.com 8dc4133f96 Fall out from operator overloading. 2000-05-23 00:09:02 +00:00
rogerl%netscape.com 932d63213b Added operator overloading support 2000-05-23 00:08:29 +00:00
rogerl%netscape.com e562e8eb21 Fix bug #39309 - parameters must be AnyType, also vars used before def. 2000-05-23 00:06:24 +00:00
rginda%netscape.com 6fa16759c6 quieting linux warnings and fixing build bustage 2000-05-22 21:05:35 +00:00
nboyd%atg.com b76123f465 Fix formatting. 2000-05-22 03:03:37 +00:00
nboyd%atg.com 85a7b4aa6c Fix 38590. 2000-05-22 00:10:10 +00:00
cls%seawood.org cb31f6e62d More OS/2 changes. Batches 19 & 20 of Bug #34106 r=pavlov 2000-05-21 13:32:11 +00:00
brendan%mozilla.org addb7242fb Fix remove-while-enumerating, beef up metering and add JS_DHashTableDumpMeter (these files are not part of the client build). 2000-05-20 18:42:22 +00:00
brendan%mozilla.org 0858bc61ea Fix old stddev calc bug (#ifdef'd code, not part of build). 2000-05-20 18:41:13 +00:00
cls%seawood.org df5725e323 Finishing off the standalone modules framework.
List js/src/liveconnect & js/src/xpconnect in toplevel Makefile.in to allow js to be built using the standalone framework.
Use the <module>_STANDALONE defines anytime BUILD_MODULES != all.
r=slamm
2000-05-20 02:45:59 +00:00
brendan%mozilla.org e1b56a4ce1 Use int for shift type consistently; optimize primary hash match (NOT PART OF BUILD). 2000-05-19 18:26:37 +00:00
rogerl%netscape.com 408e469b4b Playing with operator overloading & Type types. 2000-05-19 17:41:10 +00:00
beard%netscape.com 091146e0f7 fix const cast away linux breakage 2000-05-19 05:38:29 +00:00
brendan%mozilla.org 725ff208a6 Don't clear memory gratuitously (after create-error; after destroy). 2000-05-19 05:10:58 +00:00
brendan%mozilla.org 83d65f9508 Don't destroy what hasn't been created (NOT PART OF BUILD). 2000-05-19 03:49:32 +00:00
brendan%mozilla.org 91e4edcef8 Experimental double-hashing code, hope to donate to nsprpub/lib/ds (NOT PART OF BUILD). 2000-05-19 02:51:20 +00:00
mccabe%netscape.com 65950e22ec Patch xpcshell.cpp to not try to call JS_malloc with 0 bytes.
Patch courtesy Mark G. Adams <madams@livepage.com>

r=mccabe

This code is part of xpcshell, and doesn't go into the mozilla product.  Prior to this fix, xpcshell crashed on startup.
2000-05-19 00:34:46 +00:00
rogerl%netscape.com 79201b942d Bunch o' expression ops. 2000-05-18 00:04:15 +00:00
rogerl%netscape.com 477b9aecd9 Moved genExpr to ICodeGenerator - added most expression ops. 2000-05-18 00:03:23 +00:00
rogerl%netscape.com f38a2dd543 Moved genExpr to ICodeGenerator 2000-05-18 00:01:33 +00:00
beard%netscape.com f82644b580 added on run handler 2000-05-17 20:02:17 +00:00
beard%netscape.com ebd9cea0c3 Removing obsolete project file. This is supplanted by js.mcp.xml. 2000-05-17 20:01:08 +00:00
cls%seawood.org a8000b8bb5 Mass replace of -lmozjs with $(MOZ_JS_LIBS) needed for OS/2 and consistency. 2000-05-17 06:45:45 +00:00
brendan%mozilla.org 7bc9169a36 Include jsstddef.h first in all js*.c files (r=tlundeen@webcrossing.com). 2000-05-17 06:24:45 +00:00
brendan%mozilla.org 7dd0a4f6c4 JS_DestroyRuntime nukes all contexts; add JS_G/SetRuntimePrivate (r=tlundeen@webcrossing.com). 2000-05-17 06:23:03 +00:00
pavlov%netscape.com 803190ad4b changes all usages of NS_NewTimer to CreateInstance 2000-05-17 02:49:35 +00:00
sfraser%netscape.com 7c1335fa2a Fix to only broadcast to the autoreg observer if we are really registering. 2000-05-17 01:54:18 +00:00
mkaply%us.ibm.com 68897b7076 # 37239
r= rogerl
OS/2 bring up continues - fix for floating point trap
2000-05-16 22:51:12 +00:00
beard%netscape.com aa18b202a8 ensuring both arguments to max are the same type 2000-05-16 22:23:15 +00:00
rayw%netscape.com 18fabd3cae Added the fixes for 35866 and one older bug to the js component loader.
This means it is more careful about how it writes binary filenames in
the registry and it calls an observer to report autoregistrations.

This should have gone out with equivalent Native Component Loader fixes,
but it didn't.
2000-05-16 05:09:31 +00:00
cls%seawood.org 8a94c9df50 Latest OS/2 makefile changes. Bug 34106. Batch 14, 15, & 16. 2000-05-16 04:41:54 +00:00
brendan%mozilla.org 98af3bcf58 Fix GC request debiting to cope with multiple JSContexts on the same thread (39321, r=shaver). 2000-05-16 02:44:27 +00:00
rogerl%netscape.com 02d34752cd Bug #39034. Fixed stupid logic that broke \n, sorry. 2000-05-15 21:48:00 +00:00
brendan%mozilla.org 26edd3b893 Common a string literal (js_call_str; r=shaver). 2000-05-15 20:21:05 +00:00
brendan%mozilla.org 453918e0e2 Remove deadwood brought to my attention by tlundeen@webcrossing.com (r=shaver). 2000-05-15 20:04:41 +00:00
brendan%mozilla.org d69376f26f Fix stupid 0-for-enumerator-equal-to-0 warning (r=shaver). 2000-05-15 20:03:13 +00:00
mscott%netscape.com 09228d712f backing out rayw's checkin because the tree WAS CLOSED! Shame on you =). 2000-05-15 18:07:36 +00:00
rayw%netscape.com e3232d90a0 I needed to add a better comment for the prior version I checked in.
Bug 3690, I added the native character writing / escaping logic to
the javascript components as it was added to native components.

r=dveditz
2000-05-15 17:29:20 +00:00
rayw%netscape.com 6e8adc1631 The remaining fix for international characters in component names. 2000-05-15 17:26:18 +00:00
brendan%mozilla.org 44ffcfa883 Enforce interCaps Mozilla XPIDL style (r=shaver). 2000-05-15 07:03:46 +00:00
brendan%mozilla.org 2fcf1e1f5e Update JS_InitClass to match signature. 2000-05-15 06:07:10 +00:00
brendan%mozilla.org 6d9f9c1954 Comment the need for rooted JS_NewScriptObject; whitespace/comment cleanup. 2000-05-15 06:06:12 +00:00
brendan%mozilla.org 53e6c7a2fa Cleanups from tlundeen@webcrossing.com, plus fun->call=>native renaming. 2000-05-15 03:54:50 +00:00
brendan%mozilla.org 46bb75c8df Forgot to check this in with the last batch! 2000-05-14 23:04:33 +00:00
brendan%mozilla.org 1afb3be62c GC synchronization and lock fixes, plus comments (37983, r=waterson@netscape.com). 2000-05-14 23:00:51 +00:00
shaver%mozilla.org ee453f5618 remove bogus CHECK_REQUEST in JS_ClearRegexpStatics (16128) 2000-05-14 15:38:04 +00:00
brendan%mozilla.org 2152d1c678 Set newborn to root of object tree created by literal (followup to waterson nsJSEnvironment.cpp fix). 2000-05-14 05:38:51 +00:00
brendan%mozilla.org 48a16c808c Avoid zero-length mallocs (prompted by ped@nospam.cadence.com). 2000-05-14 05:35:19 +00:00
beard%netscape.com 312fe40643 fix for linux bustage 2000-05-13 02:14:52 +00:00
waldemar%netscape.com e4b1d1c7b0 Simplified grammar without changing syntax 2000-05-13 00:18:56 +00:00
beard%netscape.com 95c604b7cc added jsc/Main.java. 2000-05-12 06:23:43 +00:00
waldemar%netscape.com 1038627ac0 Fixed ?: parsing bug and pretty-printing offsets 2000-05-12 05:39:28 +00:00
waldemar%netscape.com e0d60183af Fixed build flags 2000-05-12 05:16:08 +00:00
waldemar%netscape.com 4332726ebb Fixed parser errors 2000-05-12 05:15:52 +00:00
waldemar%netscape.com 87e3817578 Worked around Visual C++ problem 2000-05-12 05:15:17 +00:00
waldemar%netscape.com 6f509ed95c Interchanged linearBreak and fillBreak 2000-05-12 03:43:35 +00:00
waldemar%netscape.com 0a6fc9df09 Turned on expression parsing and printing 2000-05-12 03:26:43 +00:00
waldemar%netscape.com 66582beffd Added expression parsing and printing code 2000-05-12 03:26:24 +00:00
waldemar%netscape.com f240e58708 Added RawArrayBuffer::reserve_advance_back 2000-05-12 03:25:49 +00:00
beard%netscape.com 7e8c26b8ab removed unnecessary #include <iomanip> 2000-05-12 01:46:16 +00:00
beard%netscape.com 71c6e11ea9 InterpretStage -> Context::Event. 2000-05-12 01:20:34 +00:00
beard%netscape.com 5323c7b05c Fixed signed/unsigned warning. InterpretStage -> Context::Event. Context::removeListener now using find() from <algorithm>. 2000-05-12 01:19:39 +00:00
beard%netscape.com 04581163ba InterpretStage -> Context::Event. Added typedefs for ListenerList and ListenerIterator. 2000-05-12 01:17:32 +00:00
beard%netscape.com 314e712f22 turned off extra comma warnings. 2000-05-12 00:31:48 +00:00
rogerl%netscape.com b29b7084fa post inc/dec 2000-05-11 00:35:43 +00:00
rogerl%netscape.com 3dd4d8ff15 Added post inc/dec for properties & names. 2000-05-11 00:35:06 +00:00
mccabe%netscape.com b97688b654 Mark 'clear' function exposed thru shell global object PR_CALLBACK, like other similar functions.
Patch courtesy Skip Nizinski <snizinsk@us.ibm.com>.
2000-05-10 23:58:51 +00:00
rogerl%netscape.com 1f1c369c98 Bug #38384, fix from norris (which I tweaked a little) to handle a bug in
recursive reseting of the thisObj in InterpreterData.
2000-05-10 22:03:15 +00:00
brendan%mozilla.org d422e712d9 Reword comment to fix typo (missing 'to'). 2000-05-10 20:05:17 +00:00