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

1820 Коммитов

Автор SHA1 Сообщение Дата
rginda%netscape.com 460603af1d Moved test from js1_2 section 1999-12-06 23:32:25 +00:00
rogerl%netscape.com 2aea48f5af version() must have int type argument.
Fixed VERSION setting to match shell.js
Fixed 'pass!' string to match 'pass'
1999-12-06 22:47:51 +00:00
rogerl%netscape.com 50b35580d5 version() must have int type argument.
Fixed VERSION setting to match expected string in shell.js
1999-12-06 22:46:46 +00:00
rogerl%netscape.com 56d9ddc6f5 version() must have int type argument 1999-12-06 22:45:53 +00:00
norris%netscape.com e9d1f871b7 Fix ecma_3/ExecutionContexts/10.1.4-1.js 1999-12-06 19:03:21 +00:00
rginda%netscape.com f8be02c7e7 * README-jsDriver.html
Minor wording changes.

* jsDriver.pl
  Display negative list in output, fix display of test list as part of output (which was broken by the multiple test-list change)
  Added hours field in tastcase duration output (man that sparc20 is slow.)
1999-12-06 04:29:18 +00:00
rginda%netscape.com 4a049b3cdb Backing out. 1999-12-05 04:34:15 +00:00
rginda%netscape.com 23ea0358bd Checking in JS Component changes for shaver
"<shaverAway> slamm reviewed, I made the diff, it's a tested fix"
I built and ran here as well.
1999-12-05 03:36:59 +00:00
rginda%netscape.com c353bf74f2 * runtests2.pl was renamed to jsDriver.pl
jsDriver.pl now supports multiple lists to be specified in the -l argument,
and directory names as well.  Directory names can also be used in list files.
'Negative' lists are supported as well.  They consist of a list of tests to skip, and are of the same format as the regular lists.

* README-jsDriver.html
  man-like html page describing how to use jsDriver.pl
1999-12-05 02:15:22 +00:00
waldemar%netscape.com 1fff1418d4 Clean grammars on allegro to save memory 1999-12-04 05:04:08 +00:00
waldemar%netscape.com 2299109d45 Added canonical LR(1) grammars and grammar cleaning 1999-12-04 05:03:20 +00:00
waldemar%netscape.com 09fd8db28a First Checked In. 1999-12-04 05:01:34 +00:00
waldemar%netscape.com d1a96fc050 File Removed. 1999-12-04 05:01:06 +00:00
beard%netscape.com b930468a1d removed NativeClosure.java. 1999-12-04 00:32:16 +00:00
norris%netscape.com 33535e3b14 Fix instanceof. 1999-12-04 00:21:41 +00:00
norris%netscape.com 77400866c1 clean up tests 1999-12-03 23:54:36 +00:00
norris%netscape.com 3c8d260145 eval() called indirectly should throw an EvalError 1999-12-03 23:44:58 +00:00
norris%netscape.com aeab7546b9 Fix ecma_2/Exceptions/exception-006.js 1999-12-03 23:32:46 +00:00
norris%netscape.com a63bc514b9 Remove spurious quote 1999-12-03 23:17:43 +00:00
norris%netscape.com 4d33f84af9 VAR --> var 1999-12-03 23:16:23 +00:00
waldemar%netscape.com f7b49b1b05 Implemented line-grammar and added utility functions for analyzing grammar state table 1999-12-03 22:53:21 +00:00
waldemar%netscape.com ffe7afd37a Implemented variant-constraints 1999-12-03 22:52:18 +00:00
waldemar%netscape.com 436bc8e750 Implemented line-grammar 1999-12-03 22:51:27 +00:00
waldemar%netscape.com 15793d4cc3 Implemented variant-constraints. Added all-state-transitions. 1999-12-03 22:50:45 +00:00
waldemar%netscape.com 5357f74106 Changed comments 1999-12-03 22:49:36 +00:00
waldemar%netscape.com f4d100a1e2 First Checked In. 1999-12-03 22:49:10 +00:00
waldemar%netscape.com 37d714ab95 Added :sort-key to sorted-hash-table-keys 1999-12-03 22:48:52 +00:00
norris%netscape.com 6213e7ae3f Fix regressions. 1999-12-03 21:50:42 +00:00
rogerl%netscape.com 0f9eca4866 Switch to ECMA error. 1999-12-03 02:58:29 +00:00
rogerl%netscape.com 4c286f0250 Don't let Undefined prototype be assigned to new objects, revert to Object
instead. Also, detect Undefined prototype in hasInstance and bail.
1999-12-03 00:10:36 +00:00
norris%netscape.com 51068bf196 Fix the following bug:
Subject:
            Rhino request URGENT
       Date:
            Thu, 02 Dec 1999 15:58:40 -0500
      From:
            slobo@espialgroup.com
        To:
            Norris Boyd <norris@netscape.com>
 References:
            1 , 2




Hello Norris

In Rhino, the following script gives the error : "function does not always return a value" during the parsing phase. The script
runs perfectly fine in Netscape 4.61. It is an urgent requirement. Many thanks in advance.

Steven

///////////////////////////////////////////////////////SCRIPT  BEGIN  ///////////////////////////////////////////////
function test (a) {
  this.arg = a;
  if (a>20)
        return;
  return this;
}

//print = alert;

function joe() {
a = new test (20);
print (a.arg);


a = new test (25);
print (a.arg);
}

joe();
///////////////////////////////////////////////////////SCRIPT   END  ///////////////////////////////////////////////
1999-12-03 00:04:46 +00:00
fur%netscape.com 42f42f7011 Fix 20594: C++ comments in C files 1999-12-02 22:41:02 +00:00
norris%netscape.com 26afc24746 remove invalid test 1999-12-02 20:04:48 +00:00
norris%netscape.com 136d21ac6f EvaluatorExceptions should set an exit error code. 1999-12-02 19:12:34 +00:00
norris%netscape.com 54912ce1a7 Pass a scope to ScriptRuntime.call so we can throw EcmaErrors if need be. 1999-12-02 18:17:22 +00:00
waldemar%netscape.com 445f739dc0 NOT IN BUILD. Added strdup to make Mac standalone js engine work again 1999-12-02 03:05:14 +00:00
waldemar%netscape.com 6fd8a95ec7 Fix to bug 17263: toPrecision when called with no arguments. r=shaver 1999-12-02 03:04:31 +00:00
rogerl%netscape.com 68e586ec9e Added missing null scope parameter. 1999-12-02 01:33:22 +00:00
rogerl%netscape.com 2f671616d5 Passing scope down into parser/IRFactory/NodeTransformer so that syntax
errors can be packaged as ECMA Error objects.
1999-12-02 01:16:02 +00:00
rogerl%netscape.com e01b13c759 Bug #19980 - insist on curly-brace after catch block rather than just
accepting it - forces error that allows catch block to span lines for
interactive input.
1999-12-01 23:12:58 +00:00
norris%netscape.com 35ed67ffec Fix js1_3/regress/in-001.js 1999-12-01 18:43:12 +00:00
norris%netscape.com ec2aef2474 Fix test ecma_2/Exceptions/string-001.js 1999-12-01 18:05:49 +00:00
rginda%netscape.com c5125cbc23 Testcase produced no output is no longer a failure. 1999-12-01 06:29:27 +00:00
rginda%netscape.com 72a01ffe23 Added new ecma_3 suite. along with 'new style' (hopefully simpler) shell.js, and
a new test (which fails already!)
1999-12-01 06:07:28 +00:00
waterson%netscape.com 75eb57a1df xpconnect is a component now on Linux/PPC, albeit a broken one... 1999-12-01 05:20:16 +00:00
brendan%mozilla.org 2a963196c5 Fix obscure eval bug and ECMA conformance issue (20256, r=rginda@netscape.com). 1999-12-01 04:30:04 +00:00
rogerl%netscape.com a5c0875b49 Call createFunctionObject on closure created InterpretedFunction objects
so they can be real JS objects like they're supposed to be -with prototypes
and everything.
1999-12-01 02:45:58 +00:00
drapeau%eng.sun.com 3a3de239a0 My bad: orphaned code fix for bug 5369. The rest of this bug fix was
checked in some time ago, but this portion of the fix never made it
it.  r=drapeau@eng.sun.com.  Log error when LiveConnect cannot be
started due to an error in the Java VM.
1999-12-01 01:43:16 +00:00
drapeau%eng.sun.com 36a49c7cb3 Fix for bug 14666 ("Running this JavaToJavaScript test causes
apprunner to crash."), fix contributed by
jeff.dyer@compilercompany.com, r=drapeau@eng.sun.com. Checks whether
there's a current valid context; if there's no context, don't bother
checking if an exception is pending on that context.
1999-12-01 00:44:08 +00:00
jband%netscape.com dbc38c79c5 My contribution to bug 5403. Get rid of xpconnect's ServiceReleaser scheme because we can now just call Release on a service just like any other xpcom object. r=mccabe 1999-12-01 00:27:09 +00:00
norris%netscape.com 5ad67e721a anal: fix indentation 1999-11-30 23:54:51 +00:00
rginda%netscape.com b6a1a75c47 Added liveconnect option to runtests2.pl, there are now so many shells supported that the -e|--engine=<type> option has replaces all the individual engine options, such as -d, -o, and -r.
Updated bugnumber in the function-001(-n)?.js files, and minor simplification in the 10.1.3 testcase.
1999-11-30 22:16:34 +00:00
rginda%netscape.com e6ee0b96d0 Defined __LITTLE_ENDIAN in fdlibm on x86 linux, fixes various Math object issues, r=rogerl@netscape.com 1999-11-30 00:43:03 +00:00
mccabe%netscape.com ecb7806801 Additional Date object APIS courtesy 'Chris' Houck. r=mccabe. 1999-11-30 00:42:07 +00:00
rginda%netscape.com 7ed274b845 Changes to make list selection page work correctly on windows platform. 1999-11-29 22:31:45 +00:00
rogerl%netscape.com 50b2e1ebdf r=norris
Moved 'ok' to MatchState. Re-wrote matchGreedyKid to reduce stack
usage and allow succesful completion to propagate out. #9141
1999-11-29 22:06:22 +00:00
bryner%uiuc.edu 31301221b2 Minor changes to fix building on Linux with --enable-oji. r=shaver. 1999-11-29 20:27:00 +00:00
brendan%mozilla.org 6a6109e43c Destroy rt->stateChange condvar (also trim deadwood; 20168, r=beard@netscape.com). 1999-11-28 19:56:52 +00:00
brendan%mozilla.org 2048f5b74e Fix decompiler to search function clone prototypes for args and vars (20160, r=rginda@netscape.com). 1999-11-28 09:46:33 +00:00
warren%netscape.com 4ab4ee4d4e Eliminated the libs build pass. 1999-11-28 03:05:01 +00:00
brendan%mozilla.org 1212d7a599 Eliminate Closure per ECMA ed. 3, fix brutal sharing of lambdas (20076, r=rogerl,shaver). 1999-11-25 03:25:30 +00:00
shaver%netscape.com 1e29947595 - report function name, if any, when warning about mismatched return
- change catchguard syntax to avoid ECMA conflict
- light XDR cleanup
1999-11-24 03:36:25 +00:00
rginda%netscape.com ca7546867b * Makefile
Add target for windows systems.
* runtests2.pl
  Add xpcshell option, no longer requires \n at end of list file.
* ecma/ExecutionContexts/10.1.3.js
  Reformatted.
1999-11-23 22:35:35 +00:00
norris%netscape.com bb088da102 delete of non-reference just evaluates to true. 1999-11-23 17:36:17 +00:00
norris%netscape.com eadef0d104 Add ConversionError and make it work for undefined.foo. 1999-11-23 17:30:31 +00:00
norris%netscape.com bf8cbd877b Remove commented-out code. 1999-11-23 17:29:53 +00:00
norris%netscape.com 5a2dba3040 Fix formatting. 1999-11-23 17:29:34 +00:00
jband%netscape.com 8df6b9a809 fixup the exported api declarations to use JS_PUBLIC_API in a consistent fashion r=mccabe 1999-11-23 01:02:28 +00:00
norris%netscape.com bce104a346 Fix test failures:
ecma_2/Exceptions/expression-020.js
js1_4/Regress/date-001-n.js
js1_4/Regress/toString-001-n.js
1999-11-22 23:48:06 +00:00
rginda%netscape.com 004eef0bf8 Return exitcode 3 on runtime errors, and 4 on 'file not found's; added to js and xpc shell,
r=jband
1999-11-22 23:28:58 +00:00
norris%netscape.com f3b2f0b638 Fix
Testcase ecma_2/Exceptions/expression-020.js failed
Failure messages were:
result = this.eval("NaN") (threw No exception thrown) = NaN FAILED! expected: Passed
1999-11-22 19:35:59 +00:00
norris%netscape.com 0343b19f7f 'thisArg' could be null, so use 'fun' for scope. 1999-11-22 19:35:20 +00:00
jband%netscape.com 0173df06ba removing the .cvsignore file in an abandoned directory so that using -P with cvs will trim the thing out of a tree 1999-11-22 05:46:56 +00:00
cls%seawood.org 1a2699f584 When cross-compiling, we want to use the header generated from NSPR defines. 1999-11-21 16:06:53 +00:00
duncan%be.com 196ff89c01 Make locale work under BeOS (added XP_BEOS next to XP_UNIX). r=nhotta
Make JS timing work under BeOS (added XP_BEOS next to XP_UNIX). r=mcafee
Make nsSigHandlers.cpp build under BeOS (strsignal returns const char *). r=mcafee
1999-11-20 10:53:34 +00:00
rginda%netscape.com 4d390f03b5 tweaked html output, added test duration time. 1999-11-20 07:50:43 +00:00
rginda%netscape.com e50de21c72 Added javapath, and confail options. Made some trace output come out by default so it isn't so eerily quiet in quiet mode. 1999-11-20 05:22:20 +00:00
waldemar%netscape.com 61070bffbe Fixed MCL incompatibility 1999-11-20 04:34:42 +00:00
jband%netscape.com b64ec3335e r=fur Conform to the recently changed semantics of nsHashtableEnumerator::IsDone to fix the infinite loop that started happening in the Components.[interfaces,classes,classesByID] enumerators 1999-11-20 04:21:58 +00:00
waldemar%netscape.com c9c34bf66c Added Allegro reference 1999-11-20 02:18:26 +00:00
waldemar%netscape.com 134c6fefaf Updated to work under Allegro Common Lisp 1999-11-20 02:16:56 +00:00
rginda%netscape.com db611ebed7 s/FAILED!/{return a failure}/ in testcase description to keep from fooling the test driver. 1999-11-20 01:43:44 +00:00
rginda%netscape.com 5f289038d5 Correct exit codes on win32, echo output file regardles of -t 1999-11-20 00:28:06 +00:00
norris%netscape.com ca76b17037 Fix ecma_2/Expressions/instanceof-003-n.js
ScriptRuntime::instanceOf now needs a scope parameter that it can use to construct an exception object
1999-11-20 00:19:00 +00:00
norris%netscape.com eb298c15ba argument.caller shouldn't be defined in the default version 1999-11-19 23:02:52 +00:00
rginda%netscape.com 6e23182854 Add bugnumber to reports, bugzilla url option, and expect exit code 3 for negative tests. 1999-11-19 21:54:46 +00:00
rginda%netscape.com 510c390d39 s/perl5/perl/ 1999-11-19 01:18:33 +00:00
rginda%netscape.com b5d7c51679 Added most.tests, most of the tests, minus liveconnect and some date/array tests that take a long time. 1999-11-19 00:57:18 +00:00
rginda%netscape.com 38e5dfe58a HTML output is in, script generally useful. Not tested on win32 or mac yet. 1999-11-19 00:56:17 +00:00
brendan%mozilla.org 0d66307ac4 - Add JS_HAS_FUN_EXPR_STMT jsconfig.h macro and use it to ifdef a special case explicitly specified by ECMA ed. 3 to be an error: a function expression that's a statement (not at top-level). This allows one to wrap functions in if and else statements and conditionally define them.
(More work is needed to conform to ECMA ed. 3 by removing Closure objects; also we want more efficient closure calling, soon.)

- Move mislocated call to js_FoldConstants from jsemit.c's js_EmitTree, the TOK_FUNCTION case, back to jsparse.c.  This avoids redundant fold-walks over non-top-level functions.  Folding should be done at tree-gen time, not at code-gen time.

- Eliminate dead code in if-else and ?: when folding constants.

- Release tempPool arena space before early return on error in js_FoldConstants, just to be nice (all arena space gets released eventually, when the compiler finishes).
1999-11-18 20:19:56 +00:00
shaver%netscape.com 54fb7cb54b Fix some MLK and FMR badness.
Use nsCOMPtr to manage services (thank you dp, thank you).
Only push context on stack when actually executing JS via JSAPI.
Use nsXPIDLCString to simplify memory management (thank you waterson,
thank you).
Use generic module stuff.
r=fur,jband
1999-11-18 15:39:28 +00:00
jband%netscape.com 4dbdf4a0ca remove invalid assertion 1999-11-18 04:30:54 +00:00
rginda%netscape.com 92dcf9cfb2 Added ^c handler, beginnings of html output. 1999-11-18 04:14:00 +00:00
rginda%netscape.com 6130ec762c * menuhead.html
make all targets "other_window" to reduce number of open windows.
* mklistpage.pl
  make all targets "other_window" to reduce number of open windows.
* runtests2.pl
  more hacking, still not done.
1999-11-17 22:33:05 +00:00
rginda%netscape.com 66eace8ec4 Initial checkin of "import test list" dialog. 1999-11-17 22:31:07 +00:00
rginda%netscape.com 215c9fb617 * Global.java
Cleared global.exitCode in quit() just to be safe.
* Main.java
  Adjusted exit code constants to match the js and xpcshells.
1999-11-17 20:26:17 +00:00
rogerl%netscape.com 32dc38be7a Changes for JS1.5 build under AIX4.3.
(Not a part of SeaMonkey builds)
1999-11-17 18:34:04 +00:00
brendan%mozilla.org 91f5474c6d Unregress top-level lambda expressions not in with statements to avoid full closure overhead. 1999-11-17 07:41:12 +00:00
brendan%mozilla.org 9dea6e1311 Whitespace, comment, and bracing diffs. 1999-11-17 04:32:37 +00:00
brendan%mozilla.org 0c23adf941 Brutal sharing followup (15146, r=shaver@mozilla.org)
- jsinterp.c changes: 
__- JSOP_CLOSURE comment fixes.
____(NB: ECMA ed 3 seems to require that we abolish the Closure object altogether, replacing it with a new Function object where we used to make a new closure.  That says we should use JS_CloneFunctionObject or an internal form (js_).) 
__- Use obj rather than the same-valued fp->scopeChain as fourth argument to js_ConstructObject. 
__- JSOP_DEFFUN change to auto-clone when running a script in a different scope from the one the compiler used for static function scope linkage. 
__- Remove bogus assertion from JSOP_DEFVAR/CONST: case.

- jsparse.c/.h changes:
__- Restored outerFun test to FunctionDef in jsparse.c, so that we make a closure if (outerFun || lambda || !funAtom) -- i.e., if we're compiling
____- A function statement within an active function via eval;
____- We're compiling a function expression statement (not at apparent-to-compiler top-level; part of some kind of compound statement, e.g. if or with);
____- Or the function, even at top statement level and not in another function, has no name. 
__- Don't predefine local variables at compile time if they're in with statement
__- Enforce const at compile time for local consts

- Minor jsemit.[ch] cleanup.
1999-11-17 04:13:05 +00:00
rginda%netscape.com ddf7c8abff Initial add of new (universal) perl test driver, and test case selection tool. 1999-11-17 02:05:29 +00:00
rogerl%netscape.com a4b5bd38a3 Added changes at Jane's request.
(Not a prt of SeaMonkey build)
1999-11-17 00:05:45 +00:00
rogerl%netscape.com 611b51e8af Added new defs at Jane's request.
(Not a prt of SeaMonkey build)
1999-11-17 00:04:49 +00:00
norris%netscape.com 0bc8473ac6 Make -f semantics match those of the C engine. 1999-11-17 00:04:17 +00:00
norris%netscape.com cc086cb5fe Add contributor. 1999-11-16 23:58:11 +00:00
norris%netscape.com 607deed027 rginda's changes for having quit() take an exit code. 1999-11-16 23:57:23 +00:00
rogerl%netscape.com 8144a593a1 r=norris.
Fix overrun by back-reference digit sequence parsing.
1999-11-16 23:54:18 +00:00
rogerl%netscape.com cdcebfe33e r=norris
Fix for toString under 1.2 - calls toSource which provides extra '{}' that
doesn't match previous behaviour.
1999-11-16 23:53:33 +00:00
rogerl%netscape.com 4854c3f97e r=norris
Fixed handling of weird indices (NaN etc) for charCode and charCodeAt.
Bug #16984
1999-11-16 23:52:08 +00:00
rogerl%netscape.com 3894fb0d94 r=norris.
Changes for ECMA compatible function.apply handling of missing or null args
Bug #16984
1999-11-16 23:51:02 +00:00
jdunn%netscape.com d70d78c6bf Fixing all unresolved symbols on unix. The bug has the diff's
r dp@netscape.com (ramiro helped me with it)
# 18688
1999-11-16 06:02:31 +00:00
brendan%mozilla.org 51bd99c904 Fix exception bytecodes to use script->main (18926, r=jband@netscape.com). 1999-11-16 02:15:22 +00:00
rogerl%netscape.com 437f6d82ed Backing out changes to script.exec scope access. r=norris 1999-11-15 22:54:06 +00:00
jband%netscape.com d70c6df7f7 r=norris. Fix for bug 18702. Adds code to track whether caller to xpconnect is native or JS. This allows xpconnect to decide to not call security manager to filter calls originating from native code 1999-11-15 22:11:21 +00:00
brendan%mozilla.org 983c73ff27 Disassembler uses ToSource, not ToString, where appropriate (DEBUG only change). 1999-11-15 21:11:59 +00:00
brendan%mozilla.org 817c450eb6 Fix 18684, bad combo of old-latent and new bugs (r=shaver@mozilla.org). 1999-11-12 20:41:04 +00:00
waldemar%netscape.com bdcf4fd531 Changed external-link-base 1999-11-12 07:24:40 +00:00
waldemar%netscape.com 601517cf29 Added language declarations, ?id syntax, ^^, ^^=, units. Updated list of future reserved words. Allowed definitions in compount statements. 1999-11-12 07:24:19 +00:00
waldemar%netscape.com 7e1c468432 Updated list of keywords 1999-11-12 07:22:27 +00:00
brendan%mozilla.org c3a9800360 XULDOMJS_19991106_BRANCH landing (15146, 18025, r=shaver@mozilla.org) 1999-11-12 06:03:40 +00:00
mccabe%netscape.com e791da07ae Fix most remaining warnings in js/src. Patch courtesy slamm.
r=mccabe.
1999-11-11 21:52:35 +00:00
mccabe%netscape.com 2038be4c8f Warning fix for uninitialized structure members. r=fur,slamm. 1999-11-11 01:15:43 +00:00
waterson%netscape.com 28171fb013 Bug 18408. Use 'ObjectAt()' rather than 'Peek()', which looks at the
front of the queue. r=jband
1999-11-10 21:59:05 +00:00
shaver%netscape.com 9aa0c9d0e4 fix build bustage from big dumb shaver 1999-11-10 02:04:58 +00:00
shaver%netscape.com 74e1b89e09 - use JSThreadContextStack and JSRuntimeService (more) correctly in loader
- teach loader about unloading and deferring components
- turn off some DEBUG_shaver noise
- better error reporting
- use nsXPIDLCString
- use nsCOMPtr
- add missing cxstack->Pop() in the xpcshell
- Components.results.NS_ERROR_FACTORY_REGISTER_AGAIN (want better text for
  error message)
- handle thrown-nsresult correctly where C++ calls JS without an active JS
  stack
- remove missing cxstack->Pop() from TestXPC
r=jband,brendan
1999-11-10 00:34:26 +00:00
rogerl%netscape.com 37cda6d0ce Removed NativeClosure 1999-11-09 18:24:40 +00:00
norris%netscape.com 025bfe6158 Fix 18229: Bogus class file names being generated on Windows 1999-11-08 17:24:10 +00:00
dmose%mozilla.org 42fc94a6ec updated license boilerplate to xPL 1.1, a=chofmann@netscape.com,r=endico@mozilla.org 1999-11-06 03:40:37 +00:00
dmose%mozilla.org 7a91d8fab2 updated license boilerplate to xPL 1.1, a=chofmann@netscape.com,r=endico@mozilla.org 1999-11-06 02:47:15 +00:00
taek%netscape.com 0072dc81eb updated to use /share/builds/components 1999-11-06 02:11:18 +00:00
drapeau%eng.sun.com 69eb4dbdcf r=fur@netscape.com, approval=chofmann@netscape.com. Fix for bug 5369
("[PP]Crash on startup because of Java Plug-in 1.3 for Netscape
Navigator.")  Make the code more bulletproof by checking for NULL
arguments to several methods.  If JVM isn't running, jEnv arg should
be NULL.

This doesn't entirely fix the problem of a JVM gone awry in all cases;
in the case of this particular bug, the Sun JDK 1.3 Beta HotSpot VM
caused an error, and there's no way for Mozilla code to detect this
failure mode.  The fix for that half of the problem is to use the new
JDK 1.3 Early Access VM, which does not exhibit the problem.
1999-11-06 00:24:42 +00:00
norris%netscape.com a4e924fe2a Unify evaluation code to improve consistency and improve code size. 1999-11-05 22:18:24 +00:00
norris%netscape.com 38a8ca4e67 Remove JSuncaughtExceptionLine, use an error reporter to report line number info instead. 1999-11-05 21:48:05 +00:00
norris%netscape.com 8ad5772c17 Improve performance of the non-error call code. 1999-11-05 21:23:10 +00:00
rogerl%netscape.com 17f55ab4a6 Removed - not an ECMA thing and supplanted by a different mechanism. 1999-11-04 00:01:00 +00:00
rogerl%netscape.com 448bd845c0 Fix back-reference parsing from going too far in source string 1999-11-04 00:00:14 +00:00
rogerl%netscape.com a9e5d64d21 Replaced Closure object with FunctionObject clone 1999-11-03 23:59:35 +00:00
rogerl%netscape.com 97edcab2f0 Removed NativeClosure 1999-11-03 23:58:51 +00:00
rogerl%netscape.com cbb133796d Fix nested finally endless loop.
Replaced Closure object with FunctionObject clone.
1999-11-03 23:57:56 +00:00
rogerl%netscape.com 94ebb494f8 Add closure support 1999-11-03 23:56:28 +00:00
rogerl%netscape.com a474444e6a Removing NativeClosure 1999-11-03 23:55:59 +00:00
rogerl%netscape.com 64616a42c4 Not a part of SeaMonkey Build
- new LiveConnect AIX4.3 makefile for server builds
1999-11-03 22:55:03 +00:00
rogerl%netscape.com 732304de4e Added defn of AIX4_3 to help fix dup typedef int8,int16 etc 1999-11-03 18:56:17 +00:00
mccabe%netscape.com f8ee12e046 Fix many nsInterfaceInfo leaks, thanks in part to patches provided by Patrick Beard. Fixes 15855. Some remain.
Clear up build warnings, and quiet nsInterfaceInfomanager debug output unless DEBUG_iim.  Makes startup a li'l less noisy.  Fixes 15628.

r=jband
1999-11-03 07:23:37 +00:00
waldemar%netscape.com 842058475c Removed distribution restrictions because this is part of the language spec 1999-11-03 03:59:31 +00:00
waldemar%netscape.com cda16b1c7d Updated to Mozilla 1.1 license 1999-11-03 03:58:07 +00:00
rogerl%netscape.com 85ac1ef068 Not a part of SeaMonkey Build
- added lnker option for server folks
1999-11-03 00:28:51 +00:00
jband%netscape.com 267171e19a r=mccabe use NS_NewTimer stuff only on Win32 in this test code. This avoids Unix build order problems that were keeping the xpconnect test components from working at all. 1999-11-02 23:35:54 +00:00
jband%netscape.com 62de9600f7 r=mccabe make output from xpcshell's new 'dump' method go to the same place as output of 'print': stdout rather than stderr 1999-11-02 23:31:09 +00:00
rogerl%netscape.com 5a9571975a Added Kurt Westerfeld's fix for 'undefined is not a function' message. 1999-11-02 22:52:10 +00:00
dmose%mozilla.org a3997676e7 updated license boilerplate to xPL v1.1 1999-11-02 22:23:59 +00:00
waldemar%netscape.com 1240477065 Added more no-line-break constraints, simplified visibility treatment, and added named function arguments 1999-11-02 21:12:04 +00:00
msw%gimp.org 760c87a527 applied patch in 14263 to build xpconnect as a component on
Linux/alpha.  Should also fix 13601, 11847.
r=jband@netscape.com
1999-11-02 21:03:13 +00:00
waldemar%netscape.com 66698acfa9 Fixed constraint positioning bug 1999-11-02 20:54:44 +00:00
rogerl%netscape.com 485e507c0f More RegExp back reference specification mucking about. 1999-11-02 20:04:57 +00:00
rogerl%netscape.com babd0a87b2 Fixed up for Java vs. ECMA definitions in edge cases 1999-11-02 20:04:16 +00:00
mccabe%netscape.com 488568cc49 Reverting lib fix to fix impending bustage. 1999-11-02 07:39:51 +00:00
mccabe%netscape.com 01a56f0a66 Another stab at linking with the timer static library - this time using EXTRA_DSO_LDOPTS.
r=jband
1999-11-02 06:53:58 +00:00
jband%netscape.com 02da3dfca4 - Add test code for calling back via a timer on potentially other JSConetxt
to the xpconnect echo interface. This will help fix bug 17736. This includes
using nsITimer which is a pretty messed up xpcom interface w/o a factory.

- Added dump() to xpcshell to make it compatible with browsers debug
output method.

- reformat beard's leak fix to follow 80 column rule.

- Add a missing dont_AddRef to avoid a leak in some debug code.

r=mccabe
1999-11-02 05:55:29 +00:00
brendan%mozilla.org f6243a48b1 Fixed getter/setters, pave way for brutal sharing (15146, r=shaver@mozilla.org,rogerl@netscape.com) 1999-11-02 02:23:50 +00:00
rogerl%netscape.com b9e8b7deb0 Changed -n to regular since the error is getting detected in the code now. 1999-11-02 01:55:59 +00:00
waldemar%netscape.com df52d397b6 Added basic no-line-break constraints matching JavaScript 1.x 1999-11-02 01:46:05 +00:00
waldemar%netscape.com def01413a0 Added no-line-break constraints 1999-11-02 01:45:31 +00:00
waldemar%netscape.com 75419a6521 Fixed comment 1999-11-02 01:45:14 +00:00
waldemar%netscape.com 4ec7adb2eb Added :no-line-break 1999-11-02 01:44:24 +00:00
waldemar%netscape.com ffb65e0ed1 Fixed annoying use of *error-output* that would always bring the listener window to the front while compiling a grammar 1999-11-02 01:43:52 +00:00
rogerl%netscape.com 70c652cda0 That's much cooler - i'm putting the 0 case back then. 1999-11-02 01:31:45 +00:00
rogerl%netscape.com a500a60e32 Needed string parameter in order to pass type comparison correctly.
Added missing TITLE declaration.
1999-11-02 01:03:52 +00:00
rogerl%netscape.com 664f99659e Moved nested function out - new ECMA definition. 1999-11-02 01:02:55 +00:00
rogerl%netscape.com ae35ba0b2b Put test case in eval statement to catch error. 1999-11-02 01:02:03 +00:00
rogerl%netscape.com a0a5d2f9e6 Added missing TITLE declaration 1999-11-02 01:01:34 +00:00
rogerl%netscape.com ad3fd79de4 Belay that, the tests were fine, the code HAS changed. 1999-11-01 23:16:00 +00:00
tbogard%aol.net c9198a207c Changed NS_ENSURE_NOT to NS_ENSURE_FALSE to reflect API change. r=hyatt 1999-11-01 21:43:56 +00:00
beard%netscape.com bf1dc93163 fix nsIInterfaceInfoManager leak. bug=15380, r=jband 1999-10-30 05:48:07 +00:00
rogerl%netscape.com c8f88ac34f I changed the exepcted value for object.toString() calls on the empty
object - There's no clear documentation of the result, but the source
code unambiguously calls 'js_obj_toSource', which inserts the extra '()'
under the version1_2 flag, so I believe this is the correct result.
1999-10-29 23:02:17 +00:00
rogerl%netscape.com e5c6839d25 Changed to account for latest ECMA spec on back-references vs. octal 1999-10-29 22:50:43 +00:00
rogerl%netscape.com 5bb6a11dcb New ECMA spec for no argument calls to max & min - should return +/- Inf 1999-10-29 22:48:33 +00:00
brendan%mozilla.org 98e43cc9a1 Add JS_VersionToString and JS_StringToVersion, updated Impl. Version (13163, r=shaver@mozilla.org). 1999-10-29 22:44:35 +00:00
rogerl%netscape.com fcb1dba7c5 r=norris
Change for ECMA spec. - String.charCodeAt, etc call ToInteger on index.
Ditto - String.match(re) was constructing /undefined/ instead of empty
regexp.
1999-10-29 22:27:33 +00:00
rogerl%netscape.com 80ca9fc6da r=norris
Opinion was that Script.exec() should execute in global scope, not caller.
1999-10-29 22:25:25 +00:00
rogerl%netscape.com 8294cc8954 r=norris
Fixed accidental eating of exceptions (match loop didn't terminate on
failure). New ECMA definition (again) of back reference format.
1999-10-29 22:23:36 +00:00
rogerl%netscape.com 149a895e81 r=norris
New ECMA behaviour for max & min.
1999-10-29 22:21:54 +00:00
rogerl%netscape.com 630003ce5b r=norris
Upgrading to new ECMA - conversionError subsumed by TypeError.
1999-10-29 22:20:23 +00:00
rogerl%netscape.com fca0381c56 r=norris, Bug#16984
New error message for function.apply arguments.
1999-10-29 22:19:04 +00:00
rogerl%netscape.com eec3580ecd New, spawned from AIX4.2.mk. 1999-10-29 21:14:31 +00:00
jband%netscape.com b2c71c3c9b r=shaver@mozilla.org
- Fix for bug 13419 - xpconnect calls wrapped JS objects on wrong JSContext.
Added code to use the nsThreadJSContextStack in order to call wrapped
JS object on the JSContext that is current for the running thread.

We've made the rule that xpconnect only supports one JSRuntime. We
partially enforce that here by enforcing that the JSContext on which
we will run code hails from the same JSRuntime as the JSContext on
which the wrapper for the JS code was built.

Because it is perfectly legal for the nsThreadJSContextStack to be empty
if a wrapped JS object is being called from code other than a DOM event,
this system will lazily create a JSContext for the current thread and
maintain it in TLS. This JSContext is used as necessary. If it uses such
a JSContext that was not already on the nsThreadJSContextStack then the
system will temporarily push that JSContext onto the nsThreadJSContextStack
during the course of the function call being performed. This is all managed
my a new auto class: AutoPushCompatibleJSContext. This is used in the two
places where wrapped JS code is called from native code.

[the two places where this system is invoked are currently disabled due to
the fact that the DOM code makes bad assumptions about the JSContext on
which DOM objects can be accessed. We are working to fix that and then this
code will be enabled.]

- Add #ifdef XPC_DETECT_LEADING_UPPERCASE_ACCESS_ERRORS code that will help
users when we do things like fix bug 14460. As soon as we make more of the
idl declarations of methods leadingLowercase then we will have
LeadingUppercase calls from JS breaking at runtime. It is expected that this
will especially be a problem for coders working with the same interfaces
from both C++ and JS (since from C++ an interface has LeadingUpper methods and
the *same* interface seen from JS has leadingLowecase names). This code
(as suggested by shaver) will print out an informative error message when
it detects the misuse. This is currently enabled for DEBUG builds only.

- Copy code from xpcshell to TestXPC to use the JSRuntimeSerivce.

r=norris@netscape.com
- Check to see if a wrapped JS object has a QueryInterface property before
trying to call that method. This is a speed optimization. It also and makes
norris happy because his perrenial breakpoint in jsReportErrorNumber is not
getting hit (even though the old code was safe).
1999-10-29 05:42:41 +00:00
mccabe%netscape.com 0031e240f2 adding comments 1999-10-29 00:26:19 +00:00
mccabe%netscape.com 4765341f7e Add an API entry point for building JS Date objects from millisecond values.
Patches courtesy Chris Houck.  r=mccabe.
1999-10-28 22:11:41 +00:00
norris%netscape.com 18cde77084 Fix spelling of contributor's name. 1999-10-28 17:43:43 +00:00
brendan%mozilla.org 59caacf4e4 Fix bogus assertion (r=shaver@mozilla.org) found by chouck@geocast.com. 1999-10-28 02:50:15 +00:00
fur%netscape.com 343eb0d4cd Removed unused variable declaration to eliminate warning 1999-10-28 02:48:32 +00:00
fur%netscape.com 6fea510d3a Eliminated references to long-dead jsaddr.[ch].
Note: These files only used in standalone JS, not SeaMonkey build.
1999-10-28 02:45:01 +00:00
fur%netscape.com 65d039625f Removed unused files - they have been dead for years 1999-10-28 02:42:49 +00:00
rogerl%netscape.com 8f57c3272c Changed commandline option for classpath to 'classpath' instead of 'cp' 1999-10-27 22:22:56 +00:00
rogerl%netscape.com 18fd9855d1 Error message for apply argument type 1999-10-27 22:17:44 +00:00
rogerl%netscape.com 81c0d08d38 ECMA handling of undefined args for call & apply. 1999-10-27 22:17:05 +00:00
rogerl%netscape.com cc732387b7 Handle LINE & SOURCEFILE in dumpIcode
Fix bug in multiple try/catch clauses after a catch - the tryStackTop was
being decremented twice.
1999-10-27 22:16:15 +00:00
rogerl%netscape.com d935bcc715 Handle missing arg in match_or_replace 1999-10-27 22:14:46 +00:00
rogerl%netscape.com a5795eb216 ECMA specified handling of NaN inputs for max & min 1999-10-27 22:11:43 +00:00
rogerl%netscape.com 9bbac00b7f Subsumed ConversionError into TypeError 1999-10-27 22:10:36 +00:00
sfraser%netscape.com 23b4cda2b7 Really change to using the NSComponent library. the opt target still had NSStartup. r=moose. 1999-10-27 06:31:40 +00:00
rogerl%netscape.com e8f48b9e26 Changed from pic to PIC for Solaris build per Vishy. 1999-10-26 20:34:55 +00:00
norris%netscape.com f568b465b6 Remove method duplication in NativeGlobal.
Add javadoc comments to EcmaError.
1999-10-26 17:22:23 +00:00
norris%netscape.com 272cd30a80 Get filename and line number into uncaught exception reports. 1999-10-26 17:06:12 +00:00
brendan%mozilla.org 11200ff7a6 - Chouck's changes to grow a JSIdArray if necessary in JS_Enumerate, with my
code review and fixes (r=chouck@geocast.com).  He needs this cuz he has no
  knowledge of exact number of properties before new-style enumerating them.
- Patch up jsdbgapi.c a bit -- it needs to use OBJ_GET_ATTRIBUTES and new APIs
  to do a better job describing properties to a debugger.
- Add JSMSG_CANT_DESCRIBE_PROPS for bogus non-native error case in jsdbgapi.c.
- Fix "Inappropriate" => "invalid" in JSMSG_BAD_ARRAY_LENGTH message.
1999-10-25 19:24:03 +00:00
norris%netscape.com 67c18acd0c Add contributors. 1999-10-25 17:52:48 +00:00
norris%netscape.com 43d6dcf526 Add license text. 1999-10-25 17:41:49 +00:00
norris%netscape.com 608c323aba Add license boilerplate. 1999-10-25 17:36:20 +00:00
norris%netscape.com fa8870089d Should get ReferenceError exception for name not found. 1999-10-25 16:41:24 +00:00
norris%netscape.com 3b332c3835 Add contributors. 1999-10-25 16:40:30 +00:00
dp%netscape.com 0733ace331 bug#16742 Fixing delete on nsISupports. Thanks for patch from
<heikki@citec.fi> r=dp
1999-10-23 17:34:55 +00:00
jband%netscape.com a2bf64ef64 r=mccabe
Primarily fixes to properly handle nsIXPCSecurityManager vetos of
xpconnect activities.

- The code was not propagating security manager vetos of native wrapping up
through xpconnect internals. So, xpconnect was erroneously masking the
security exception with its own 'failed to convert param' exception.
This effects the signatures of nsXPCWrappedNative::GetNewOrUsedWrapper
and nsXPCWrappedJSClass::GetNewOrUsedClass.

- This propagation also helps with the problem that sometimes interfaces
are not set as [scriptable] and we did not make that clear as the source
of xpconnect's failure to convert a param in calling a method. Now this
specific class of exceptions is indicated in the JS exception object when
this happens.

- Added an explicit call to js_ForceGC on shutdown of xpcshell to aid in
avoiding 'false positives' in leak detection

- Return JS_FALSE rather than JS_TRUE when an exception is thrown in
xpcjsid to make the jsengine notices the exception.

- Move #includes that others added in xpcmodule.cpp to xpcprivate.h in
order to maintain the include conventions of this module.

- Avoid throwing an exception if it represents a security manager veto
and the security manager set an exception already.

- Replace uses of nsCOMTypeInfo<> added by scc with NS_GET_IID macros.

- Fixed a methodname misspelling because reviewers care about stuff
like that :)
1999-10-23 07:20:04 +00:00
beard%netscape.com 923861d24d synched. 1999-10-22 22:39:51 +00:00
beard%netscape.com 71f6a206ac changed SharedGlobal.java to Global.java 1999-10-22 22:39:23 +00:00
norris%netscape.com b5bbaa31df Changes for improved errors-as-exceptions handling. 1999-10-22 22:02:58 +00:00
norris%netscape.com fc4ba15202 Use simpler, more widely applicable structure for global. Also avoids test failure for Function called as a function. 1999-10-22 22:00:21 +00:00
norris%netscape.com b29858df93 A NativeString object shouldn't be unwrapped to a primitive. 1999-10-22 21:58:54 +00:00
norris%netscape.com ab350ea41b Shouldn't test for equality against the message string, which is implementation independent. 1999-10-22 18:33:46 +00:00
norris%netscape.com 9a8c3dfaeb Don't print out control characters that break the driver. 1999-10-22 17:31:59 +00:00
norris%netscape.com 079455f8ab Fix formatting. 1999-10-22 16:58:30 +00:00
norris%netscape.com 38c1cad9a0 Fix javadoc 1999-10-22 16:56:56 +00:00
ramiro%fateware.com a426b260aa Removing the badly rotten MOZ_STRIP_NOT_EXPORTED hack. We now have a better
way to accomplish the same thing using linker version scripts.
r=cls@seawood.org
1999-10-22 07:11:43 +00:00
brendan%mozilla.org c46577b077 Avoid gratuitous initialization and extra sets of ok (r=shaver@mozilla.org). 1999-10-22 01:44:47 +00:00
rogerl%netscape.com ace733bf91 Loop from 1 instead of 0 since the test result parsing gets messed up by
the null strings not containing 'PASSED'. The 0 case isn't all that
important for upperCase testing.
1999-10-21 22:18:52 +00:00
waldemar%netscape.com 60174b9647 Changed bottom expressions to syntax error throws 1999-10-20 20:58:07 +00:00
waldemar%netscape.com dc9f364011 Added upper-case Greek letters 1999-10-20 20:57:37 +00:00
waldemar%netscape.com d4bbf7cd7e Removed types from bottom expressions 1999-10-20 02:27:53 +00:00
waldemar%netscape.com b55f9ec5ab First Checked In. 1999-10-20 02:27:34 +00:00
waldemar%netscape.com 2990b743e1 Changed syntax of getters and setters to "get name" and "set name". Relaxed grammar constraints on definitions. Changed over to colon syntax for types. Added local visibility and block modifiers. 1999-10-20 00:46:31 +00:00
waldemar%netscape.com f3d863d69f Removed octal escapes. Replaced bottom by throw of syntax error. 1999-10-20 00:43:58 +00:00
waldemar%netscape.com 6a022dcba1 Removed octals. Removed rational-to-integer, which was replaced by semantic subtyping. Replaced bottom by throw of syntax error. 1999-10-20 00:43:22 +00:00
waldemar%netscape.com 8bf0421c92 Removed rational-to-integer and types in bottom calls, which were replaced by semantic subtyping 1999-10-20 00:42:17 +00:00
waldemar%netscape.com dcf782950a Removed rational-to-integer, which was replaced by semantic subtyping 1999-10-20 00:41:59 +00:00
waldemar%netscape.com 7c5d2c5286 Added semantic subtyping, throw, and catch 1999-10-20 00:40:55 +00:00
waldemar%netscape.com 02648df558 Fixed bug that would sometimes emit a newline between a backslash and its following escaped character 1999-10-20 00:40:04 +00:00
rogerl%netscape.com f578335319 r=norris
Delayed functionDef from creating property until after the body parses
succesfully.
1999-10-19 21:07:45 +00:00
rogerl%netscape.com aa9c2e26ed r=norris
Fixed bug #12951 - var if for..in statement should always be of type
string.
1999-10-19 21:06:03 +00:00
norris%netscape.com 33f79a9fa4 Fixed bug. We weren't loading classes in bottom-up dependency order.
Subject:
            Re: another getClassLoader exception
       Date:
            Mon, 18 Oct 1999 22:01:24 -0400
      From:
            Andrew Wason <aw@softcom.com>
        To:
            norris@netscape.com (Norris Boyd)
        CC:
            Howard Lin <howard@softcom.com>
 References:
            1 , 2




At 05:03 PM 10/18/99 -0700, Norris Boyd wrote:
>Are you still seeing this problem?


Yes.  I just did a CVS update to get the latest stuff and we still have
this problem.

I wrote a standalone sample program that duplicates the problem.  Run
JSSupport and you should get this exception:

defineClass org.mozilla.javascript.gen.c2
Exception in thread "main" java.lang.NoClassDefFoundError:
org/mozilla/javascript/gen/c1
         at java.lang.ClassLoader.resolveClass0(Native Method)
         at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
         at
JSSupport$MySecuritySupport$DataClassLoader.loadClass(JSSupport.java:89)
         at JSSupport$MySecuritySupport.defineClass(JSSupport.java:47)
         at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
Compiled Code)
         at org.mozilla.javascript.Context.compile(Context.java:1761)
         at org.mozilla.javascript.Context.compile(Context.java:1691)
         at org.mozilla.javascript.Context.compileReader(Context.java:810)
         at org.mozilla.javascript.Context.evaluateReader(Context.java:725)
         at org.mozilla.javascript.Context.evaluateString(Context.java:692)
         at JSSupport.<init>(JSSupport.java:20)
         at JSSupport.main(JSSupport.java:9)



Andrew



>--N
>
>Andrew Wason wrote:
>
> > At 04:54 PM 10/12/99 -0700, Norris Boyd wrote:
> > >I just checked in changes so that the class calling ScriptRuntime (c5
> in your
> > >case) will load the class itself using the normal Java classloading
> mechanism
> > >rather than an explicit call to the class loader. I pushed the bits up
> to the
> > >ftp site, but it takes a bit to propagate.
> >
> > I get this exception now (debugging statements are from my code):
> >
> > SecuritySupport.defineClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c5
> > DataClassLoader.loadClass org.mozilla.javascript.gen.c4
> > using default loader com.softcom.realjava.PluginClassLoader@da9486a0
> > java.lang.NoClassDefFoundError: org/mozilla/javascript/gen/c4
> >          at java.lang.ClassLoader.resolveClass0(Native Method)
> >          at java.lang.ClassLoader.resolveClass(ClassLoader.java:545)
> >          at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport$Da
> > taClassLoader.loadClass(RealJavaScript.java:410)
> >          at
> >
> com.softcom.realjava.plugins.RealJavaScript$RealJavaScriptSecuritySupport.de
> > fineClass(RealJavaScript.java:352)
> >          at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java,
> > Compiled Code)
> >          at org.mozilla.javascript.Context.compile(Context.java:1761)
> >          at org.mozilla.javascript.Context.compile(Context.java:1691)
> >          at org.mozilla.javascript.Context.compileReader(Context.java:810)
> >
> > So when c5 is being loaded by my SecuritySupport, it also needs to load c4.
> > I decompiled org.mozilla.javascript.gen.c5 and it's constant pool
> > references CLASS org.mozilla.javascript.gen.c4, so c5 is dependent on c4
> > being loadable.  Is the problem that c5 is being loaded before the
> > optimizer has defined c4?
> >
> > I get the above exception for some classes and not others.  It seems
> > consistent that I always get it for classes with dependencies on other
> > optimizer classes that haven't been generated yet.
> >
> > Andrew
> >
> > --
> > Andrew Wason
> > SoftCom, Inc.
> > aw@softcom.com

--
Andrew Wason
SoftCom, Inc.
aw@softcom.com



   JSSupport.java

                  Name:
                         JSSupport.java
                   Type:
                         Java Source File (text/java)
                Encoding:
                         base64
1999-10-19 16:38:23 +00:00
jband%netscape.com 0503271fe7 trivial fix to get rid of warning from copy/paste error - was passing unused argument to printf 1999-10-19 08:00:29 +00:00
beard%netscape.com c1f48b75f9 changed NSLibraryStartup.o to NSComponentStartup.o, since it's really a component. r=jband 1999-10-19 06:31:49 +00:00
jband%netscape.com 6868764b91 fixing brendan's copy/paste bug that broke gc. r=shaver 1999-10-19 05:58:07 +00:00
cls%seawood.org ff88c66302 Use PR_TRUE instead of c++ keyword "true" in case of broken/out-of-date compilers.
r=syd
1999-10-19 05:38:27 +00:00
jband%netscape.com 87f852459b checking in code to fix bug 12768 submitted by Dan.Oscarsson@trab.se. Needed a 'const char*' tmp varible to work with a 'const char*' buffer that was passed in. The same problem is in both js.c and xpcshell.cpp. r=jband 1999-10-18 23:45:39 +00:00
jband%netscape.com f4071145f8 checking in bug 16629 fix to cbegle's xpconnect tests submitted by green@FreeBSD.org. This fixes screwy longlong test methods. r=jband 1999-10-18 23:20:16 +00:00
rogerl%netscape.com 618f886f77 Changed tests for ECMA 3 definition of array.length handling. 1999-10-18 16:55:44 +00:00
jband%netscape.com bede0a53ae r=mccabe (I'll be adding more comments to the headers as requested)
Implement nsIXPCNativeCallContext to meet user feature
requirements. This allows simpler implementation of reflection of
native classes into JavaScript in cases where they need to
support legacy interfaces that include optional parameters and
method name overloading. This also provides a general mechanism
for native methods to discover if they were called from JS code,
exactly what JS parameters were passed, explicitly return jsvals,
and throw explicit jsvals without interference from xpconnect.
With test cases.
1999-10-18 02:53:04 +00:00
neeti%netscape.com cda59394de Converted dll to use nsIModule -bug 14034, r=jband 1999-10-16 03:04:16 +00:00
fur%netscape.com 34d270446b Renamed variable to avoid a compiler warning. R: mccabe 1999-10-15 21:38:04 +00:00
mccabe%netscape.com e5d67abd7b Fix line editing support for the standalone XPCOM-enabled JavaScript shell. To aid debugging on unix platforms.
To use, define JS_READLINE when compiling mozilla/js/src/xpconnect/shell.

r=shaver
1999-10-15 21:23:53 +00:00
waterson%netscape.com 3d57da5197 Add xpcnativecallcontext.cpp for jband. 1999-10-15 07:08:15 +00:00
brendan%mozilla.org d5ba97ab79 1. Fixed missing JS_LOCK_GC in JS_YieldRequest, commented other badness there.
2.  Cleaned up ugly JS_GC_Flag typedef name and put XXXbe comment in there for
    next time: someone seems to have patched around a deadlock that has since
    bit chouck@geocast.com.
3.  Fixed gcDisabled by moving it from cx to rt and updating it atomically.
4.  Fixed ECMA violation where for (var i, j in o) ... was permitted; only one
    variable is allowed.
(Item 4 was a bug on rogerl's list, since closed?  r=shaver@mozilla.org.)
1999-10-15 05:46:42 +00:00
jband%netscape.com 087dd3fe17 adding new empty placeholder file to the build. Will also add it to Mac project via camelot and put real stuff in it after all is stable. r=jband :) 1999-10-15 05:09:08 +00:00
shaver%netscape.com dc1d79b835 fix obj_getCount to property destroy state and propagate error (r=jband) 1999-10-15 04:32:46 +00:00
brendan%mozilla.org d61766ab83 Rename ToSource to uneval (r=shaver@mozilla.org,terry@geocast.com). 1999-10-15 04:07:59 +00:00
jband%netscape.com 4d756bd051 r=shaver
- Fixed two similar cases where code was missing one level of
pointer dereference in terminating a copied string. Was trashing
data further up the stack.
- Use 'nsAllocator::Free' in two similar cases where 'delete' was
mistakenly used. Error pointed out by Purify.
1999-10-15 03:31:09 +00:00
shaver%netscape.com d51225c637 make xpcshell use jsrtsvc, and let jsrtsvc handle JS_Shutdown (r=jband) 1999-10-15 03:05:48 +00:00
mgleeson1%netscape.com a42a3de7de r=pepper HPUX specific change - enable 64-bit int for js 1999-10-14 23:20:27 +00:00
jband%netscape.com ff918c4ed2 Fixing leaks found by beard...
- Fixed leaked nsID ptr. bug 16373. This alsothrows a JS
exception when JS callers call createInstance or getService
using an (optional) param that is not an iid. This had been a
'XXX' in the code.
- Moved a release call out of just the error condition block in
setting up a ServiceReleaser. I should have caught this one, but
few of my tests use services :(  I have hopes that the whole
ServiceReleaser will become unnecessary as the ServiceManager
system changes and simply calling NS_RELEASE on a service becomes
sufficient.
- Cleaned up an addref/release pair in a setter (need to move to
nsComPtrs!) r=beard
1999-10-14 23:08:59 +00:00
cbegle%netscape.com 8a5079b4f3 * removed stuff from the idl file that caused warnings
* fixed a typo that caused a warning (nsIsupports)
* fixed values of constants that caused warnings
* use a macro instead of assinging a long long value directly

r=jband
1999-10-13 00:11:21 +00:00
norris%netscape.com 8635d8f06a Fix following problem:
Subject:
        another getClassLoader exception
   Date:
        Tue, 12 Oct 1999 10:39:26 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com (Norris Boyd)
    CC:
        Howard Lin <howard@softcom.com>




Norris,

It looks like the classes the optimizer generates call
ScriptRuntime.defineFunction which calls getClassLoader.  This throws a
SecurityException.

java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader )
at
java.security.AccessControlContext.checkPermission(AccessControlContext.java
, Compiled Code)
at java.security.AccessController.checkPermission(AccessController.java,
Compiled Code)
at java.lang.SecurityManager.checkPermission(SecurityManager.java, Compiled
Code)
at java.lang.Class.getClassLoader(Class.java, Compiled Code)
at
org.mozilla.javascript.ScriptRuntime.defineFunction(ScriptRuntime.java:2045)
at org.mozilla.javascript.gen.c5.initScript(order.js)
at org.mozilla.javascript.gen.c5.exec(order.js)
at org.mozilla.javascript.Context.evaluateReader(Context.java:728)
[...]



Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-10-12 23:54:03 +00:00
norris%netscape.com d6f1d9b1e3 Fix unix build warning.
Reviewed by rogerl@netscape.com.
1999-10-12 22:48:17 +00:00
norris%netscape.com ab592add8e Remove redundant import. 1999-10-12 21:46:50 +00:00
norris%netscape.com b6ec0294ae Fix release date, add contributor. 1999-10-12 16:52:13 +00:00
cbegle%netscape.com 5c331f88b6 new files.
new tests for xpconnect.  r=jband.
1999-10-12 00:12:43 +00:00
rogerl%netscape.com c3ea9c6513 NOT A PART OF SEAMONKEY BUILD
- fixed test ECMA references,
- added test to -002
1999-10-11 22:59:25 +00:00
norris%netscape.com 1f04796183 Fix bug:
Subject:
        optimizer SecurityException
   Date:
        Mon, 11 Oct 1999 17:37:51 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com (Norris Boyd)
    CC:
        Howard Lin <howard@softcom.com>




We use our own SecuritySupport implementation in Rhino.  This is properly
getting called by the optimizer to generate new classes (e.g.
org.mozilla.javascript.gen.c5 etc.)

However, after defining the class, Codegen.compile calls getClassLoader()
on the new class.  The default SecurityManager doesn't allow
getClassLoader() to be called and so an exception is thrown:

java.lang.RuntimeException: Malformed optimizer package
java.security.AccessControlException: access denied
(java.lang.RuntimePermission getClassLoader )
        at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:138)
        at org.mozilla.javascript.Context.compile(Context.java:1761)
        at org.mozilla.javascript.Context.compile(Context.java:1691)
        at org.mozilla.javascript.Context.compileReader(Context.java:810)
        at org.mozilla.javascript.Context.evaluateReader(Context.java:725)
        [...]

This is kind of a pain to duplicate outside of our application, but if you
require a test case I can create one.

Codegen is attempting to call loadClass() after it uses
SecuritySupport.defineClass().  Our SecuritySupport calls loadClass()
internally in its defineClass() implementation.  This is what JavaAdapter
expects.

This is from Codegen.compile():

                         if (securitySupport == null) {
                             if (Context.isSecurityDomainRequired())
                                 throw new SecurityException("Required " +
                                             "security context missing");
                             if (classLoader == null)
                                 classLoader = new JavaScriptClassLoader();
                             clazz = classLoader.defineClass(name, classFile);
                         } else {
                             clazz = securitySupport.defineClass(name,
classFile,
                                                                 securityDom
securityDomain);
                         }
                         ClassLoader loader = clazz.getClassLoader();
                         clazz = loader.loadClass(name);


This is from JavaAdapter.createAdapterClass():


         SecuritySupport ss = cx.getSecuritySupport();
         if (ss != null)  {
             Object securityDomain = cx.getSecurityDomainForStackDepth(-1);
             return ss.defineClass(adapterName, bytes, securityDomain);
         } else {
             if (classLoader == null)
                 classLoader = new MyClassLoader();
             classLoader.defineClass(adapterName, bytes);
             return classLoader.loadClass(adapterName, true);
         }


So JavaAdapter is assuming SecuritySupport.defineClass() will call
ClassLoader.loadClass() on the new class, while Codegen is assuming it
needs to call ClassLoader.loadClass() on the class defined by
SecuritySupport.defineClass().

These should be made consistent, and in both cases it should be assumed
that SecuritySupport will both define and load the class.


Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-10-11 22:48:13 +00:00
rogerl%netscape.com a3ccad0ea2 NOT A PART OF SEAMONKEY BUILD
- removed redundant test & fixed test for 'super' to detect syntax error
1999-10-11 22:38:40 +00:00
jband%netscape.com 3e98f50de6 Much of this is under the auspices of bug 15794. r=mccabe.
- map xpcshell's 'quit()' to a loop exit rather than calling
'exit(0)' so that the cleanup and leak detection code will still
get called.

- add NS_InitXPCOM and NS_ShutdownXPCOM to xpcshell to run said
cleanup and leak detection code.

- use more NS_IF_* macros

- fix numerous places where code assumed that
nsXPConnect::GetXPConnect() does not add a new ref on the
xpconnect singleton object (the behavior changed some time back
but not all the uses did - brainfade!).

- fix nsXPCException::NewException to automatically trim
'dataless' native stackframes off of the front of a stack trace.
The old system of manually telling it how many frames to trim was
not working well. We really want the first frame showing to be an
'interesting' frame so that callers who get exceptions thrown at
them will see some useful information rather than an empty native
frame that represents (but says nothing about) some native frame
in the xpconnect runtime.

- remove an extra addref from the trimming loop in
nsXPCException::NewException.

- Stop building XPCJSStack objects. XPConnect stacks are singly
linked lists of XPCJSStackFrame objects with refcounted links. I
had this stupid idea that each object would have a refcounted
link to a XPCJSStack object that would tie together the lifetimes
of all objects in the chain. This was overcomplex and
unnecessary. The linked list was enough. Any frame without a
refcount deserved to be deleted because it is simply unreachable.
There was no reason to tie together all the lifetimes of each
object in the chain. So this has been simplified in a big way.

- fixed place in xpcthrower.cpp where we were leaking a refcount
on the xpconnect singleton each time an xpcexception was thrown.

- do cleanup and gc() at the end of xpctest_echo.js to use for
leak testing - all wrappers should go away.
1999-10-09 06:01:57 +00:00
rogerl%netscape.com 3321dd12a5 Fixed 14060 - calling exec on java methods was gettmg caught by exec
trapping nonsense.
1999-10-08 22:55:33 +00:00
cbegle%netscape.com b1f067ac08 Adding new files. Tests for XPConnect. These files are not part of the
build.  R=jband@netscape.com
1999-10-08 20:45:37 +00:00
kipp%netscape.com b0dcc883f8 Cleanup moz-decl-counter usage and fix NS_LOG_ADDREF usage 1999-10-08 20:41:19 +00:00
warren%netscape.com b90a06a288 Fixed AddRef/Release problems to eliminate negative refcounts in Bloaty. 1999-10-08 01:49:06 +00:00
jband%netscape.com 75f95fe0e6 fix warning of old style C++ variable scope declared in 'for'. bug 15778. r=slamm 1999-10-08 00:11:05 +00:00
rogerl%netscape.com 191067ee70 Fixed build failures - these files are NOT part of the seamonkey build. 1999-10-07 20:45:27 +00:00
rogerl%netscape.com 6819bebd25 Fixed error reporting to not smack the source line with a zero, but use
copyN instead - things were failing when very last line of input had an
error and didn't end with '\n'. r=mccabe
1999-10-07 20:44:40 +00:00
rogerl%netscape.com 3be66eaa68 Fixed build warnings by removing macros with '{..}'.
Made str_escape available for jsfile.
r=mccabe
1999-10-07 20:42:20 +00:00
rogerl%netscape.com bc37560023 Making str_escape available for jsfile use. r=mccabe. 1999-10-07 20:41:15 +00:00
rogerl%netscape.com f1902c3e90 Bug #12168. Catch new Array(NaN). r=mccabe. 1999-10-07 20:40:17 +00:00
norris%netscape.com 59ad20ea51 Fix 15711 Can't call java.lang.Class methods from JS 1999-10-07 18:27:21 +00:00
norris%netscape.com 8c12e73652 Subject:
Re: NPL vs. MPL
       Date:
            Wed, 06 Oct 1999 18:30:34 -0400
      From:
            "Ian D. Stewart" <idstewart@softhome.net>
        To:
            Norris Boyd <norris@netscape.com>
 References:
            1 , 2 , 3




Norris Boyd wrote:

  Great. So I'd like to change this copyright text

  /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset:
  4 -*-
   *
   * The contents of this file are subject to the Mozilla Public License
   * Version 1.0 (the "MozPL"); you may not use this file except in
   * compliance with the MozPL.  You may obtain a copy of the MozPL at
   * http://www.mozilla.org/NPL/
   *
   * Software distributed under the MozPL is distributed on an "AS IS"
  basis,
   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  MozPL
   * for the specific language governing rights and limitations under the
   * MozPL.
   *
   * The Initial Developer of this code under the MozPL is Ian D. Stewart.

   * Portions created by Ian D. Stewart are Copyright (C) 1998, 1999
   * Ian D. Stewart.
   * All Rights Reserved.
   */

  to this:

  /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset:
  4 -*-
   *
   * The contents of this file are subject to the Netscape Public
   * License Version 1.1 (the "License"); you may not use this file
   * except in compliance with the License. You may obtain a copy of
   * the License at http://www.mozilla.org/NPL/
   *
   * Software distributed under the License is distributed on an "AS
   * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express oqr
   * implied. See the License for the specific language governing
   * rights and limitations under the License.
   *
   * The Original Code is ListenerCollection, released
   * May 15, 1998.
   *
   * The Initial Developer of the Original Code is Ian D. Stewart.
   * Portions created by Ian D. Stewart are Copyright (C) 1998, 1999
   * Ian D. Stewart.
   * Rights Reserved.
   *
   * Contributor(s):
   * Ian D. Stewart
   *
   * Alternatively, the contents of this file may be used under the
   * terms of the GNU Public License (the "GPL"), in which case the
   * provisions of the GPL are applicable instead of those above.
   * If you wish to allow use of your version of this file only
   * under the terms of the GPL and not to allow others to use your
   * version of this file under the NPL, indicate your decision by
   * deleting the provisions above and replace them with the notice
   * and other provisions required by the GPL.  If you do not delete
   * the provisions above, a recipient may use your version of this
   * file under either the NPL or the GPL.
   */

  Can you give me your approval for this change?

Make it so.


Ian
1999-10-07 16:57:01 +00:00
rogerl%netscape.com ad0ec07339 More errors-as-exceptions stuff 1999-10-06 23:55:33 +00:00
norris%netscape.com 500507c3bb More license wrangling: fix the release date (1999, not 1998). 1999-10-06 21:52:17 +00:00
jband%netscape.com 4629012b8e - the rest of the fix for bug 14738 - detect JSErrors with
JSErrorReports when thrown as exceptions. Extract JSErrorReport
and convert to an xpcexception. This restores functionality that
was whacked when JS errors-as-exceptions was enabled in the JS
engine.
- add conversion support for string-with-length as part of array
support mentioned in bug 13420. All the array stuff is basically
in with minimal testcases. More comprehensive tests need to be
written to verify and tune the code.
- fix a broken #undef
- switch to using PR_Alloc/PR_Free internally in nsjsid where we
were using new/delete before. This is prompted by warren's change
to nsID::ToString that uses PR_Alloc were before it used new.
This fixes an alloc/delete mismatch detected by Purify.
r=mccabe
1999-10-06 21:35:27 +00:00
sspitzer%netscape.com 754c0a321b fix for #15197 (and a whole bunch of duplicates).
fix by vidur, r=rogerl
1999-10-06 21:31:34 +00:00
beard%netscape.com 06350965dc added EcmaError.java, NativeError.java 1999-10-06 21:07:04 +00:00
norris%netscape.com 80580793fe Update contributors, add some license text. 1999-10-06 20:50:04 +00:00
cbegle%netscape.com 2bd0e3b5d8 tests for javascript errors as exceptions, a feature that was recently
added to the javascript engine.

not part of the build.
1999-10-06 20:45:44 +00:00
norris%netscape.com 31a6dc99ed Make sure creation of class loader is inside a try block to handle security exceptions. 1999-10-06 17:39:48 +00:00
brendan%mozilla.org 64e97e6f4c Fix Object.prototype.toSource so it parenthesizes outermost-toSource literals for eval roundtrips. 1999-10-06 09:09:31 +00:00
brendan%mozilla.org 18ed82e11a Top-level ToSource function for primitive type roundtrips. 1999-10-06 06:37:55 +00:00
brendan%mozilla.org 65be78b626 Fix two multi-threaded GC-rooting bugs:
- js_NewFunction wasn't initializing (clearing) JSFunction members before it
  linked the JSFunction to a JSObject that the GC could reach from a root.
- Make sure frame.scopeChain is cleared before linking frame via cx->fp, even
  though we set frame.scopeChain to some object later (another signal that we
  should rework js_Invoke to inline it and otherwise optimize it).
1999-10-06 06:29:43 +00:00
rogerl%netscape.com 38529d8a6c Added version 150, changed version testing in regexp 1999-10-06 00:10:27 +00:00
rogerl%netscape.com 62a34b909d Bug #14545 - get array length exceptions working with non-Number array
contructor arguments.
1999-10-05 22:11:57 +00:00
jband%netscape.com af9f78c665 the JS engine part of the fix for bug 14738. This does two things: 1) expose the JSClass for JSError so that it is possible to detect from the outside if a given JSObject is of that JSError class, and 2) expose an api call via which the JSErrorReport can be extracted from a JSError (if present). This change required renaming the JSClass used for JSError, so many lines were touched 1999-10-05 21:07:23 +00:00
rogerl%netscape.com ce191ed5b1 Errors as exceptions working from generated code. 1999-10-05 19:44:24 +00:00
kipp%netscape.com 3f773d307d r=jband; fixed a memory leak 1999-10-05 14:56:41 +00:00
mccabe%netscape.com f82c305737 Initial checkin of TestScan.java, a simple driver for generating and printing various kinds of parse trees, and for profiling scanning, parsing and compiling. 1999-10-05 03:47:04 +00:00
dmose%mozilla.org 931d55d3be update license boilerplate to NPL dual w/GPL, r=norris@netscape,a=norris@netscape.com 1999-10-05 01:42:01 +00:00
dmose%mozilla.org 068c6bb828 update license boilerplate to NPL dual w/GPL, r=norris@netscape,a=norris@netscape.com 1999-10-05 00:44:05 +00:00
rogerl%netscape.com 95a8da471d First cut at errors as exceptions - These changes should be benign since
the errors are being wrapped by runtime exceptions and still need to be
explicitly caught (this is happening in the interpreter, but not in
generated code).
1999-10-05 00:21:07 +00:00
waterson%netscape.com ce673a63e9 Bug 15367. Dump 'class' instead of 'file/line' for NS_LOG_REFCNT. r=shaver,dp 1999-10-05 00:07:54 +00:00
norris%netscape.com 312ce3abcc Fix up makefiles; previous patch was mis-applied. 1999-10-04 21:31:21 +00:00
norris%netscape.com 6c5683afd4 Fix bug found by Andrew Wason (see below).
Problem was that one transformation of a node to GETVAR wasn't protected by a check of inWithStatement().

======================================
Subject:
        multiple scopes
   Date:
        Fri, 01 Oct 1999 12:39:14 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        Howard Lin <howard@softcom.com>




When I create two scopes, and one scope evaulates a string in the other
scope, it works.  However, if I do this while handling an exception thrown
within a JavaAdapter method, it fails with an exception.

Run the attached Java program with the two script files.  scope1.js
evaluates a string "printMessage" in the scope of scope2.js.  This returns
a function object which is then invoked.  This works in 3 cases, but fails
in the 4th (in the catch in the JavaAdapter).  Even in the 4th case where
it fails, printing the function object looks normal.

Am I doing something wrong, or is there a bug here?

java CrossScope scope1.js scope2.js

Outside of JavaAdapter
works before exception
works after exception
Inside of JavaAdapter
works before exception
Caught exception
pma=
function printMessage(msg) {
     java.lang.System.out.println(msg);
}

Exception in thread "main" org.mozilla.javascript.JavaScriptException:
org.mozilla.javascript.EvaluatorException: The undefined value has no
properties.
         at
org.mozilla.javascript.JavaScriptException.wrapException(JavaScriptException
.java:61)
         at
org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java,
Compiled Code)
         at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1256)
         at org.mozilla.javascript.Interpreter.interpret(Interpreter.java,
Compiled Code)
         at
org.mozilla.javascript.InterpretedScript.call(InterpretedScript.java:49)
         at
org.mozilla.javascript.InterpretedScript.exec(InterpretedScript.java:37)
         at org.mozilla.javascript.Context.evaluateReader(Context.java:697)
         at CrossScope.<init>(CrossScope.java:30)
         at CrossScope.main(CrossScope.java:10)


Thanks,
Andrew

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

public class CrossScope {
	private Context m_jsContext;
	private Scriptable m_scope1;
	private Scriptable m_scope2;

	public static void main(String args[]) throws Exception {
		new CrossScope(args[0], args[1]);
	}

	private CrossScope(String strFile1, String strFile2) throws Exception {
		// Associate Context with main thread
		m_jsContext = Context.enter();
                m_jsContext.setOptimizationLevel(-1);

		// Init scope1, expose Scope object
  		m_scope1 = m_jsContext.initStandardObjects(new ImporterTopLevel());
		m_scope1.put("Scope", m_scope1, this);

		// Init scope2
		m_scope2 = m_jsContext.initStandardObjects(new ImporterTopLevel());

		// Run script in scope2
		Reader r2 = new FileReader(strFile2);
		m_jsContext.evaluateReader(m_scope2, r2, strFile2, 1, null);

		// Eval input JS in scope1 - it can in turn eval JS over in scope2
		Reader r1 = new FileReader(strFile1);
		Object obj = m_jsContext.evaluateReader(m_scope1, r1, strFile1, 1, null);
		if (obj instanceof Throwable)
			((Throwable)obj).printStackTrace();

		m_jsContext.exit();
	}

	public Object scope1Eval(String str) throws JavaScriptException {
			Context cx = Context.enter(m_jsContext);
			Object objResult = cx.evaluateString(m_scope1, str, "scope1EvalString", 1, null);
			cx.exit();
			return objResult;
	}

	public Object scope2Eval(String str) throws JavaScriptException {
			Context cx = Context.enter(m_jsContext);
			Object objResult = cx.evaluateString(m_scope2, str, "scope2EvalString", 1, null);
			cx.exit();
			return objResult;
	}
}


// Scope1

importPackage(java.lang);

System.out.println("Outside of JavaAdapter");

try {
	var pm = Scope.scope2Eval("printMessage");
	pm("works before exception");
	System.arraycopy(null, 5, null, 5, 100);
} catch (e) {
	var pma = Scope.scope2Eval("printMessage");
	pma("works after exception");
}

var obj = new Runnable() {
	run: function() {
		System.out.println("Inside of JavaAdapter");
		try {
			var pm = Scope.scope2Eval("printMessage");
			pm("works before exception");
			System.arraycopy(null, 5, null, 5, 100);
		} catch (e) {
			System.out.println("Caught exception");
			var pma = Scope.scope2Eval("printMessage");
			System.out.println("pma=" + pma);
			pma("works after exception");
		}
	}
};

obj.run();



// Scope2

function printMessage(msg) {
	java.lang.System.out.println(msg);
}
1999-10-04 18:27:30 +00:00
beard%netscape.com 26ba00f59b changed from directly using "MSL ShLibRuntime.Lib" to using "NSLibraryStartup.o" to enable GC leak detector. r=smfr 1999-10-03 20:47:12 +00:00
beard%netscape.com b547c2ffb0 changed from directly using "MSL DropInRuntime.Lib" to using "NSComponentStartup.o" to enable GC leak detector. r=smfr 1999-10-03 20:46:23 +00:00
beard%netscape.com 120647c4c2 changed from directly using "MSL ShLibRuntime.Lib" to using "NSLibraryStartup.o" to enable GC leak detector. r=smfr 1999-10-03 20:23:01 +00:00
norris%netscape.com 3c14af2f14 Fix the following bugs:
14443 "Same origin" security policy may be circumvented using docu
14820 Fixing up the relationship between nsCodeBasePrincipal and n
14919 Crash in JS MM code
Reviewed by mstoltz, approved by scc.
1999-10-02 03:41:37 +00:00
norris%netscape.com 7b6b013b5a Contribution from Andrew Wason:
Subject:
        optimizer Makefiles
   Date:
        Fri, 01 Oct 1999 14:50:05 -0400
   From:
        Andrew Wason <aw@softcom.com>
     To:
        norris@netscape.com
    CC:
        Howard Lin <howard@softcom.com>




Norris,

Here are patches to the Rhino Makefiles to build the optimizer package and
the jsc compiler.  They also fix a problem with "gmake clean".

Andrew
--
Andrew Wason
SoftCom, Inc.
aw@softcom.com
1999-10-01 22:58:48 +00:00
norris%netscape.com f3b4f6e683 \t doesn't work on Windows. 1999-10-01 22:56:30 +00:00
kipp%netscape.com 188755230c Convert to a module from a component 1999-09-30 21:47:04 +00:00
kipp%netscape.com 843961c1ed Fixed shutdown related memory leaks 1999-09-30 21:12:33 +00:00
beard%netscape.com fca5f34231 fixed output directory 1999-09-29 16:11:58 +00:00
beard%netscape.com 893b5b6374 fixed source folder name 1999-09-29 16:10:25 +00:00
beard%netscape.com 413c8ef2c7 build debugger with CW Pro 4. 1999-09-29 16:07:22 +00:00
beard%netscape.com 36454ca749 builds the optimizer using CW Pro 4. 1999-09-29 15:55:29 +00:00
sfraser%netscape.com ff4d90f6a8 More type mismatch fixing for shavear 1999-09-29 03:07:27 +00:00
shaver%netscape.com a0d5aa9034 nsIRegistry scriptability update, r=dveditz,dp,alecf a=leaf,chofmann 1999-09-29 02:36:54 +00:00
dmose%mozilla.org 8370e8419f update license boilerplate to NPL-1.1 dual-licensed with the GPL. a=brendan, r=brendan. 1999-09-28 23:12:09 +00:00
norris%netscape.com ba6c2c928a Add example of classfile generation. 1999-09-27 23:21:01 +00:00
norris%netscape.com 89da8cb66c Changes for classfile generation. 1999-09-27 23:17:29 +00:00
rogerl%netscape.com 67dc9fdf6d Better error handling for interpreter. 1999-09-27 17:47:51 +00:00
rogerl%netscape.com a71f31edb6 Changes from Kurt Westerfield to improve error messages from Interpreter
by passing line/file data through bytecode.
1999-09-27 17:47:05 +00:00
rogerl%netscape.com 5a3d2224bb Stash originating source file for error reporting 1999-09-27 17:45:26 +00:00
rogerl%netscape.com 3da3ea5d84 ECMA 3 array length error handling. 1999-09-27 17:44:30 +00:00
rogerl%netscape.com 836156934b Execute exec in the global scope. 1999-09-27 17:43:40 +00:00
rogerl%netscape.com 00f4d796de New tokens to support better error messages from Interpreter. 1999-09-27 17:43:07 +00:00
rogerl%netscape.com 1ddb9fac14 Added -c <classpath> option to specify, you guessed it, a classpath. 1999-09-27 17:41:44 +00:00
shaver%netscape.com eb1c17fcbf unlock in fun_enumProperty, r,a=brendan 1999-09-27 08:24:36 +00:00
shaver%netscape.com ea329b2c77 properly unlock object, preventing ugly crash with |if (foo in noFoo)| 1999-09-27 06:04:54 +00:00
shaver%netscape.com 8b22629a75 Fix leak of native path in AutoRegisterComponents.
Save registry data for failed components.
Make the loader work again (fix suffix length and init crash).
Better error reporting.
1999-09-27 02:22:25 +00:00
kipp%netscape.com be6b1333d1 new 1999-09-25 20:11:47 +00:00
kipp%netscape.com 709be3f433 Init all variables, not just some of them 1999-09-25 20:07:20 +00:00
beard%netscape.com c8a74166b5 Fixed looking up 'length' property in Function objects: needed to look up prototype chain for zero arguments. Cleaned up some more, always storing Boolean.TRUE in local hash tables, rather than the method, methodKey or methodName. 1999-09-25 09:24:23 +00:00
beard%netscape.com d9a9d82316 Added ClassSignature, a key for caching generated adapter classes. Now passing superName, rather than superClass to constructor generation methods. 1999-09-25 08:11:24 +00:00
beard%netscape.com 82ff8f1cea Fixed generateSuper when override has void return type. 1999-09-25 01:37:32 +00:00
norris%netscape.com a600a94fa3 Shorten name to make Mac developers happy. 1999-09-24 21:05:41 +00:00
norris%netscape.com 9dbb033545 Patches from Kurt Westerfeld for JavaScript property access to JavaBeans.
Subject:
        Re: [Fwd: [Bug 13658] Changed - Rhino: null pointer exception on class with duplicate field/method]
   Date:
        Mon, 13 Sep 1999 20:57:32 -0400
   From:
        "Kurt Westerfeld" <kurt@westerfeld.com>
     To:
        "Norris Boyd" <norris@netscape.com>




I do have a patch for this, but it is intermixed with some other changes
that I have implemented for the get/set on Java instances (per my LC3
proposal).  The bug requires changes that are a little involved actually;
basically it seems that when getting the default value for a "field and
methods" (which combines the same-named entities), the prototype of the
parent scope is deref-ed, and the parent scope is null.  Hence, the scope
must be passed into the the cloned field and method values.

Also, the NativeJavaClass implementation passed "false" for isStatic on the
constructor of the FieldAndMethods Hashtable, which results in classes
having instance methods.  Bad.  I haven't filed a bug on that yet.
Additionally, I fixed a couple other NullPointerException nigglies thrown in
when exceptions are propagated in the same area.  Finally, when getting the
default value for the field, it is helpful to convert a Scriptable to string
when that is requested (as when typing in the console).

I am attaching the changed files.  The LC3++ code can be removed if you
want, which I can do for you but it will take a little longer.  What is your
preference?

-----Original Message-----
From: Norris Boyd <norris@netscape.com>
To: Kurt Westerfeld <kurt@westerfeld.com>
Date: Monday, September 13, 1999 4:54 PM
Subject: [Fwd: [Bug 13658] Changed - Rhino: null pointer exception on class
with duplicate field/method]


>Kurt,
>
>Is this the bug that your patch fixes?
>
>Thanks,
>Norris
>
1999-09-24 20:41:43 +00:00
norris%netscape.com 71bee08e21 Remove '.js' from SECTION. 1999-09-24 20:16:55 +00:00
norris%netscape.com e3ce18cbc8 Propagate files from old netscape code. 1999-09-24 20:05:59 +00:00
norris%netscape.com 4c9c27afaa Implement the "cast" of java class objects so that js objects in java adapters can
use 'this' for the implemented java interface.
1999-09-24 18:20:08 +00:00
beard%netscape.com 45eaa0a35f Added "generateSuper" which generates a method called "super$method()" which when called calls "super.method()." This is provided to support full sub-classing of Java classes from JavaScript. 1999-09-24 18:17:05 +00:00
beard%netscape.com 6c69fd36dc added a prototype field, so that a wrapped JavaAdapter can preserve the delegate object's original prototype chain. 1999-09-24 16:52:23 +00:00
beard%netscape.com d06b137123 setAdapterProto: now splices in wrapper's prototype, rather than replacing object's original prototype chain. seems to work fine. 1999-09-24 16:51:25 +00:00
mscott%netscape.com 0dc3695919 fix build bustage for dp. 1999-09-24 02:52:46 +00:00
dp%netscape.com c39d8df3c8 Fixing jsloader not to hold reference to component manager. (shaver)
Some initialization of members and checking at desctruction. (dp)
1999-09-24 01:37:44 +00:00
rogerl%netscape.com 8cb72034b7 New error for wacky array lengths, ECMA 3 1999-09-23 23:19:00 +00:00
cbegle%netscape.com 4074949318 update script to report an error if no tests passed. 1999-09-23 23:00:38 +00:00
cbegle%netscape.com 31047a3404 just changing the section name so it doesn't break norris's script. 1999-09-23 22:59:20 +00:00
norris%netscape.com 3d5cdd4959 Fix some Array tests in the ecma suite. 1999-09-23 20:37:56 +00:00
norris%netscape.com b48d0978c2 change FAILED color to red 1999-09-23 17:26:22 +00:00