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

3791 Коммитов

Автор SHA1 Сообщение Дата
pschwartau%netscape.com af2f4f83da Initial add. Regression test for bug 102725. 2001-10-10 01:32:28 +00:00
jband%netscape.com 9151e75d3c NOT PART OF BUILD. bug 44675. bug 98209. New files 2001-10-09 23:42:22 +00:00
pschwartau%netscape.com 89c61b47ea Skip this test for now. Currently uses the non-EMCA 'it' object of SpiderMonkey. 2001-10-09 23:28:21 +00:00
pschwartau%netscape.com 2211da88b5 Initial add. Regression test for bug 99663. 2001-10-09 23:12:16 +00:00
rginda%netscape.com 8a3f2761d0 bug 103831, r=cls, sr=jband
remove java stubs
2001-10-09 21:43:15 +00:00
dbradley%netscape.com 56ae9afcc9 bug 102750 - Can't call JSIID.equals from web content. r=mstoltz, sr=jband 2001-10-09 18:54:37 +00:00
nboyd%atg.com b29a38854b Fix name of function in error message 2001-10-09 00:54:49 +00:00
jband%netscape.com 1dee213c59 fix bug 103259. Avoid crasher by correctly marking sharedscriptable object so that JSClasses don't get collected prematurely even when wrapper is 'stillborn' and not reflected into JS. r=dbradley sr=vidur. 2001-10-08 19:56:25 +00:00
rginda%netscape.com a84aff6f80 bug 102785, r=dp, sr=shaver, a=asa
remove venkman startup listener so we don't have to load the dll at startup.
checking into 0.9.5 branch also.
2001-10-08 19:44:35 +00:00
nboyd%atg.com 885a1b2303 Fix for problem:
There is a bug in JavaScriptException which prevents it from being used with
out a Rhino Context.  When the getMessage() method is invoked on it, the
exception goes to the ScriptRuntime to toString the value.  If you have
already exited your context, the runtime will throw an error.  The solution
is to simply remove the overridden getMessage method from
JavaScriptException.  JavaScriptException's constructor calls the Exception
constructor with the toString'ed value.  The default implementation of
getMessage will return the exception message.

Jeff
2001-10-07 18:44:39 +00:00
nboyd%atg.com 9ede74ab1e Fix for the following problem:
I'm having problems getting inner class objects with Rhino.

I create a Hashmap, which is an implementation of Map. Map.Entry is an
inner interface of Map with key-value pairs. If I have a Map object,
"property", I should be able to get the key element with the expression
"property.key".

When I look at the "property" class name that Rhino returns I get:
"java.util.HashMap$Entry". I don't believe Rhino has a notion of the
inner Map.Entry object. The expression "property" succeeds. The
expression "property.key", which should retrieve the Map.Entry
keyValue(), fails with a "unexpected IllegalAccessException accessing
Java field".

I'm including a simple example that illustrates the problem. I hope you
can shed some light on this. Thanks!

Justyna
< Justyna.Horwat@Sun.com >

----
import java.io.*;
import java.util.*;
import org.mozilla.javascript.*;


public class MapTest {

    public static void main(String argv[]) {
        Test test = new Test();
        test.testMap();
    }
}

class Test {
    Map map;
    Set set;
    Iterator it;
    Map.Entry entry;

    public void testMap() {
System.out.println("testMap");
        map = new HashMap();

        populate();

        set = map.entrySet();
        it = set.iterator();

        // let's see if Map is populated correctly
        while (it.hasNext()) {
            entry = (Map.Entry) it.next();
            System.out.println("entry: " + entry.getClass().getName());
            System.out.println("key: " + entry.getKey());
            System.out.println("value: " + entry.getValue());
        }

        evaluate();
    }

    void populate() {
        map.put("firstKey", "firstValue");
        map.put("secondKey", "secondValue");
        map.put("thirdKey", "thirdValue");
        map.put("fourthKey", "fourthValue");
    }

    public void evaluate() {

        Context cx = Context.enter();
        Scriptable scope = cx.initStandardObjects(null);

        set = map.entrySet();
        it = set.iterator();

        while (it.hasNext()) {
            entry = (Map.Entry) it.next();
            scope.put("property", scope, cx.toObject(entry,scope));
        }

        Object eval = null;

        try {
            // attempt to get Map.Entry key value using Rhino
            eval = cx.evaluateString(scope, "property.key", "", 0,
null);
            // Unwrap scoped object
            if (eval instanceof Wrapper)
                eval = ((Wrapper) eval).unwrap();

        } catch (JavaScriptException jse) {
            System.out.println("EXCEPTION: " + jse.getMessage());
        }

        // DELETE
        System.out.println("RHINO result: " + eval + ":");
        System.out.println("RHINO class: " + eval.getClass().getName());
    }
}
2001-10-07 18:42:09 +00:00
jaggernaut%netscape.com f7ae567b08 Bug 81444: eliminate |null_nsCOMPtr|. Eliminating all callers, r=syd, rs=mozbot. 2001-10-07 10:58:39 +00:00
jaggernaut%netscape.com 25694acfa3 Clean up REQUIRES lines. 2001-10-07 10:35:41 +00:00
brendan%mozilla.org 3aa1438307 Fix bogus return JS_FALSE without error report for empty flat string regexp match/replace (83293, r=rogerl, sr=shaver). 2001-10-06 08:07:43 +00:00
pschwartau%netscape.com 87a55de8e6 Improving comments and readability. 2001-10-05 20:32:12 +00:00
pschwartau%netscape.com 24c64d0410 Improving comments. 2001-10-05 18:36:06 +00:00
pschwartau%netscape.com 1ce3152074 Initial add. Tests sparse arrays. 2001-10-05 18:27:40 +00:00
pschwartau%netscape.com 7588eb4f9d Skip test of (non-ECMA) fileName, lineNumber properties of Error objects 2001-10-05 16:25:55 +00:00
pschwartau%netscape.com 5b71f872e7 Initial add. Regression test for bug 50447. 2001-10-05 16:19:37 +00:00
pschwartau%netscape.com 32025e8f8e Slight changes - 2001-10-05 02:07:47 +00:00
pschwartau%netscape.com 5aaedfdc26 Improving readability - 2001-10-05 00:25:11 +00:00
pschwartau%netscape.com a7c1b069e8 Including more RegExps. Not checking expected vs. actual matches now; just that we don't crash. 2001-10-04 23:58:24 +00:00
pschwartau%netscape.com b402f482ce Initial add. Regression test for bug 103087. 2001-10-04 19:54:04 +00:00
pschwartau%netscape.com bf2a7da8ce Fixing bug that prevented -p option from working on the Mac (again!) 2001-10-04 02:08:16 +00:00
brendan%mozilla.org 0ba7918e66 Fix for bug 99663 (for loop resolves properties of the object being enumerated
with JSRESOLVE_ASSIGNING, wrongly), plus a few miscellaneous bugfixes.

- Combine the JSStackFrame members constructing, special, overrides, and
  reserved into a uint32 flags member.

- Separate JOF_ASSIGNING from the JOF_SET bytecode format flag, and impute
  JSRESOLVE_ASSIGNING from the presence of JOF_ASSIGNING among the current
  opcode's format flags.  To handle the for-in loop opcodes, which do more
  than simply assign -- in particular, they do property lookups whose resolve
  hook outcalls should not be flagged with JSRESOLVE_ASSIGNING -- a new frame
  flag, JSFRAME_ASSIGNING, has been added.

- Fix interpreter version selection to respect JS_SetVersion, whose effect on
  cx->version is "sticky".

- Fix js_DecompileValueGenerator to deal with JSOP_ENUMELEM -- it never had,
  as this testcase shows (it crashes without this patch):

    version(120);
    eval("function fe(s) { for (it[s] in this); }");
    try { fe('rdonly'); } catch (e) { print(e); }
2001-10-03 06:39:30 +00:00
dbradley%netscape.com 66dc7e949f bug 100665 - Maybe xpconnect should not init the XPCOutArg JSClass. r=jband, sr=shaver 2001-10-03 02:57:42 +00:00
dbradley%netscape.com 3e85d01bb2 Bug 102294 - printf has an extra parameter. r=jband 2001-10-03 02:48:40 +00:00
nboyd%atg.com bbf6be4e2c Patch from Igor:
My optimization for PreorderNodeIterator has a bug that would cause an attempt
to access stack[-1] in
    currentParent = (current == null) ? null : stack[stackTop - 1];
when current refers to a start node sibling. This is not visible in Rhino because
currently PreorderNodeIterator is always started from nodes with node.next == null.

iter.diff fixes that plus it removes currentParent field because it is always
available as stack[stackTop - 1] and code to access its value are executed less
frequently than the lines to update it in nextNode

Regarsd, Igor
2001-10-02 12:49:46 +00:00
dbaron%fas.harvard.edu 0cc7ea34da Bug 45797: replace remaining uses of deprecated macros NS_IMPL_QUERY_INTERFACE and friends with NS_IMPL_QUERY_INTERFACE1 and friends and remove the deprecated macros. r=jag sr=alecf 2001-10-02 03:18:08 +00:00
nboyd%atg.com 607a3c6086 Fix bug:
var passed = true;
try {
    eval("/* mello /* yello */");
    } catch (e) {
        print(e);
        passed = false;
    }
print(passed);

should print "true", not "false".
2001-10-01 14:25:30 +00:00
jaggernaut%netscape.com cd894610d1 Checking in updated mac project file for Venkman (the JS Debugger) 2001-09-30 12:39:29 +00:00
rginda%netscape.com 3cbb02048d - not built -
remove java references, add jsd_xpc.cpp note, explain jsdb.
2001-09-30 08:52:04 +00:00
rginda%netscape.com b74c9a9cfb move REQUIRES line above include config.mak, to fix bustage 2001-09-30 07:10:21 +00:00
rginda%netscape.com 7d633b2f82 fixing REQUIRES bustage 2001-09-30 06:28:38 +00:00
brendan%mozilla.org 2871bfbfab Check in patch for bug 94580, thanks to Bernard Alleysson <balleysson@bigfoot.com> for researching and writing it (r=me, sr=shaver). 2001-09-29 21:30:26 +00:00
nboyd%atg.com 0679a8f54a Patch from Igor:
As profiler data show, the execution time of the nextNode and replaceCurrent
methods in PreorderNodeIterator contribute quite significantly to the total
time to run Context.compileReader.

replaceCurrent is slow because it calls Node.replaceChild which have to
iterate through all previous siblings to find the nearest to the current.
But it is easy to avoid this search by caching the previous sibling of the
current while iterating over the node tree in nextNode.

nextNode slowness is attributed to the usage of java.lang.Stack which is
expensive due to its synchronized methods. In the attched patch I replaced
it by the explicit array management.

It allows to cut Context.compileReader time by 5%-30% when processing
20K-3MB sources assembled form JS files in the test suite.
2001-09-29 20:55:36 +00:00
nboyd%atg.com 5b3af2de2d More javadoc 2001-09-29 20:55:03 +00:00
nboyd%atg.com 0783a94aa4 Move serialization classes to separate package. 2001-09-29 20:54:08 +00:00
nboyd%atg.com 9f75ff8405 Move serialization classes to new package. 2001-09-29 20:50:59 +00:00
nboyd%atg.com 96663e8b43 Move serialization files to separate package. 2001-09-29 20:50:18 +00:00
jaggernaut%netscape.com fdc4078bc4 Bug 100476: Convert uses of member functions ToNewUnicode, ToNewCString and ToNewUTF8String to their global versions and remove support from nsCString and nsString. r=dbaron, rs=scc 2001-09-29 08:28:41 +00:00
bryner%netscape.com eaaec88e31 Fixing xpctools build on win32. r=cls. 2001-09-29 06:24:41 +00:00
dbradley%netscape.com e09c0d931b Items moved to bugzilla or have already been addressed 2001-09-29 00:13:34 +00:00
dbradley%netscape.com 590b2425d0 Bug 97967 - leak of nsLocalFile on failure. Patch by dbaron, r=dbradley, sr=jband 2001-09-28 21:49:00 +00:00
gerv%gerv.net f385eb981a Relicensing Round 1, Take 2. Most C-like NPL files -> NPL/GPL/LGPL. Bug 98089. 2001-09-28 20:14:13 +00:00
pschwartau%netscape.com ba33f099f2 Initial add. Regression test for bug 101964. 2001-09-28 04:50:52 +00:00
nboyd%atg.com 7adac6233c Remove obsolete comment about serialization. 2001-09-27 15:14:24 +00:00
nboyd%atg.com f5a5117009 Add new serialization API classes. 2001-09-27 14:59:59 +00:00
shaver%mozilla.org a332dd0962 Bug 94506: parameter named "arguments" is not accessible in JavaScript method.
Now we check for the magic "arguments" name after var-and-arg slot
optimizations. r=rogerl, sr=brendan
2001-09-27 14:52:14 +00:00
nboyd%atg.com f30bd39789 Add docs for serialization. 2001-09-27 14:51:20 +00:00