Commit Graph

5597 Commits

Author SHA1 Message Date
igor%mir2.org
090b7d646d Fixing NativeGlobal.encode: it was broken for chars beyond 0xFFFF as it sb.setLength(k) was called after k was increased to consume the second char from UTF-16 encoding to build UCS-4.
git-svn-id: svn://10.0.0.236/trunk@152729 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-12 19:05:47 +00:00
igor%mir2.org
e894b7bdf0 Preparations for 1.5R5
git-svn-id: svn://10.0.0.236/trunk@152725 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-12 18:13:00 +00:00
brendan%mozilla.org
249fbf859b Fix Expression to stop on : only if hookLevel is not elevated.
git-svn-id: svn://10.0.0.236/trunk@152663 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-11 08:30:20 +00:00
brendan%mozilla.org
5aa112d362 Checkpoint, still not quite metacircularly bootstrapped.
git-svn-id: svn://10.0.0.236/trunk@152662 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-11 07:57:19 +00:00
brendan%mozilla.org
b2a9180db2 Fix two nits in last checkin.
git-svn-id: svn://10.0.0.236/trunk@152661 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-11 07:51:50 +00:00
brendan%mozilla.org
42c8b66573 NARCISSUS ifdefs and related general fixes (r=shaver).
git-svn-id: svn://10.0.0.236/trunk@152659 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-11 07:21:59 +00:00
jst%mozilla.jstenback.com
854468a176 Fixing bug 233307. deCOMtaminating nsIScript* and related interfaces. r+sr=bryner@brianryner.com.
git-svn-id: svn://10.0.0.236/trunk@152565 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-09 22:48:53 +00:00
igor%mir2.org
509cd7e28a Fixing bug 233274: for/in loop goes through array elements in wrong order
Fix: populate ids array in NativeArray with dense indexes first

Since array literals in Rhino creates instances of NativeArray with the
internal dense array containing literal elements, the patch changes
NativeArray.getIds to return ids array with dense indexes coming first and
indexes for elements added later after that.


git-svn-id: svn://10.0.0.236/trunk@152428 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-06 20:16:36 +00:00
igor%mir2.org
afbe867b94 Adding backward compatibility to SecurityController so it can be used with Rhino 1.5R4.1 subclasses
git-svn-id: svn://10.0.0.236/trunk@152370 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-05 15:10:52 +00:00
kyle.yuan%sun.com
33f1a73932 Bug 110584 Missing call to jsj_ExitJava
use |break| instead of |return| in |switch|
r=xiaobin.lu, sr=brendan


git-svn-id: svn://10.0.0.236/trunk@152266 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-04 02:01:54 +00:00
brendan%mozilla.org
414e3b02bb - ECMA-prescribed {DontEnum} attributes for length on empty arg list, and on
<any-function>.prototype.constructor.
- Put rarely-set default properties in prototypes.
- Improve a couple of comments.


git-svn-id: svn://10.0.0.236/trunk@152249 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-03 23:58:03 +00:00
brendan%mozilla.org
07f8f0409c JS implemented in JS, initial checkin.
git-svn-id: svn://10.0.0.236/trunk@152201 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-03 03:28:54 +00:00
timeless%mozdev.org
7eaea205a1 Bug 137193 Debug Mozilla aborts when JSObject.call("func", args) and args is zero-length array
r=kyle sr=brendan


git-svn-id: svn://10.0.0.236/trunk@152172 18797224-902f-48f8-a5cc-f745e15eee43
2004-02-02 19:10:33 +00:00
pschwartau%netscape.com
57c00ba044 Updating email address.
git-svn-id: svn://10.0.0.236/trunk@152107 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-31 01:04:51 +00:00
brendan%mozilla.org
ee77ac0954 More bug 231518 followup: non-identifier as well as reserved-id property names must be quoted/indexed, not dotted (r=shaver).
git-svn-id: svn://10.0.0.236/trunk@152092 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-30 20:34:23 +00:00
igor%mir2.org
c314764b06 Fixing bug 210605 again: for now re-throw Error instances as is without wrapping them into WrappedException so scripts would not be able to catch them.
git-svn-id: svn://10.0.0.236/trunk@152021 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-29 17:04:31 +00:00
pschwartau%netscape.com
6207775b14 Updating JS_GetImplementationVersion() to date of latest JS release (67111).
git-svn-id: svn://10.0.0.236/trunk@151932 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-28 02:10:31 +00:00
brendan%mozilla.org
c48008dcde Brace style fascism.
git-svn-id: svn://10.0.0.236/trunk@151782 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-24 00:36:10 +00:00
brendan%mozilla.org
660246582b Fix quoting/escaping of non-ASCII chars and reserved ids in all property access cases (231518, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@151754 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-23 17:52:03 +00:00
dbaron%dbaron.org
07ffb5471c Print more information about nsXPCWrappedJS objects in GC_MARK_DEBUG. b=231384 r=brendan sr=bryner
git-svn-id: svn://10.0.0.236/trunk@151653 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-21 21:09:18 +00:00
igor%mir2.org
a8bcbdff82 Removal support for deprecated getTargetClassFileName/setTargetClassFileName: they throw exception instead of calling a special proxy to avoid having probably unused any more class. If this is not true, then the methods should be restored.
git-svn-id: svn://10.0.0.236/trunk@151518 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-18 21:26:34 +00:00
igor%mir2.org
6fbd283c41 Fixing JavaDoc comments
git-svn-id: svn://10.0.0.236/trunk@151517 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-18 21:23:53 +00:00
igor%mir2.org
fd04b52604 EvaluatorException and WrappedException are public API now
git-svn-id: svn://10.0.0.236/trunk@151516 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-18 21:21:41 +00:00
brendan%mozilla.org
f9711b11a9 Fix bug reported by Adrian Klein <master@dragosan.net> where o['if'] is decompiled as o.if.
git-svn-id: svn://10.0.0.236/trunk@151509 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-18 18:31:34 +00:00
igor%mir2.org
5537bf9bee Deprecating ClassNameHelper and ClassRepository in favor of new optimizer/ClassCompiler.
git-svn-id: svn://10.0.0.236/trunk@151464 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-17 21:52:30 +00:00
igor%mir2.org
67138be31e optimizer.ClassCompiler provides new simple API for generating of class files from scripts that does not require to create Context instances.
The jsc tool is updated to use the new interface instead of using ClassNamehelper and friends.


git-svn-id: svn://10.0.0.236/trunk@151463 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-17 21:02:32 +00:00
igor%mir2.org
1aaf108722 1. optimizer/Codegen now just generates byte code classes, the instantiation of classes is done in a separated class optimizer/ClassCompiler. This is done to provide in future a simple interface to generate class files instead of complicated ClassNameHelper and friends implementation.
2. Parser now stores TokenStream instance in its field instead of having it present in each and every method signature. It allowed to simplify interaction between Parser and IRFactory where the later now uses Parser.reportError so parser van recover from syntax errors and provide better error reporting.


git-svn-id: svn://10.0.0.236/trunk@151422 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-16 18:20:22 +00:00
igor%mir2.org
0c5f6dbf35 Added setters for properties of CompilerEnvirons.java so it can be initialized
without having Context object.


git-svn-id: svn://10.0.0.236/trunk@151417 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-16 16:09:07 +00:00
igor%mir2.org
488148ca6f Renaming Context.hrowAsUncheckedException to Context.throwAsScriptRuntimeEx to better reflect its purpose, providing better documentation and making sure it throws only instances of EcmaError and EvaluatorException.
git-svn-id: svn://10.0.0.236/trunk@151415 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-16 15:14:25 +00:00
igor%mir2.org
5189a47915 Fixing bug 228336 :
This is a Rhino version of Brandan's patch from attachment 138844, bug 228087
plus code to fix overflow problem reported in bug 230216.


git-svn-id: svn://10.0.0.236/trunk@151414 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-16 15:11:31 +00:00
igor%mir2.org
9ff2001464 throwAsUncheckedException is moved from ScriptRuntime to Context as a useful API to use in external applications.
git-svn-id: svn://10.0.0.236/trunk@151382 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-15 20:41:57 +00:00
igor%mir2.org
182ef359b7 Fixing typo in comments
git-svn-id: svn://10.0.0.236/trunk@151381 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-15 20:40:56 +00:00
igor%mir2.org
90bfcf47f9 Patch from Alex Bitney to fix bug 230883
git-svn-id: svn://10.0.0.236/trunk@151377 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-15 20:10:54 +00:00
brendan%mozilla.org
3b19a173aa Unify license comment per js/src/plify_jsdhash.sed, plus comment simplification.
git-svn-id: svn://10.0.0.236/trunk@151341 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-15 02:00:55 +00:00
brendan%mozilla.org
b400313557 Anything that starts like a {min,max} quantifier but doesn't parse as one is taken as a flat string to match (228087, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@151209 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-12 21:10:26 +00:00
timeless%mozdev.org
3ef3b07d6b Bug 230522 warning C4047: 'return' : 'foo *' differs in levels of in direction from 'int'
rs=brendan


git-svn-id: svn://10.0.0.236/trunk@151181 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-11 17:26:30 +00:00
timeless%mozdev.org
cde3e8ca16 Adding support for WinXP (copied from Win2k)
git-svn-id: svn://10.0.0.236/trunk@151093 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-09 20:15:27 +00:00
bsmedberg%covad.net
7e08b118b7 Continuing to land the PACKAGING_20030906_BRANCH for bug 20640. Not part of the build, yet.
git-svn-id: svn://10.0.0.236/trunk@150973 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-07 13:37:00 +00:00
bsmedberg%covad.net
9706f93476 Beginning to land the PACKAGING_20030906_BRANCH for bug 20640. Not part of the build, yet.
git-svn-id: svn://10.0.0.236/trunk@150961 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-07 01:22:31 +00:00
igor%mir2.org
9875abf1c6 Fixing bug 229571 : code refactoring for speed optimization
git-svn-id: svn://10.0.0.236/trunk@150918 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-06 13:35:51 +00:00
igor%mir2.org
ce8135f93f Move details of parsing/code generation from Context to interpreter/optimizer to allow more pluggable compilation interface.
git-svn-id: svn://10.0.0.236/trunk@150880 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-05 13:22:40 +00:00
brendan%mozilla.org
adbc08ffcb - Eliminate WellTerminated by coalescing its call sites to the end of Statement and inlining it there. This adds a tiny bit of overhead in some cases, due to
the ON_CURRENT_LINE check, which can be proven redundant for cases such as the
debugger statement.  But the cost should be in the noise, and code size wins.

- Remove bogus lastExprType argument to WellTerminated and eliminate its only
use, in parsing an expression statement.  Also eliminate the WellTerminated
check after a function "statement" (which could be a top-level declaration, or
an instance of our function statement extension, e.g. 'if (x) function f(){}',
neither of which should require semicolon termination).

The intent of the lastExprType parameter, the WellTerminated call from the
TOK_FUNCTION case, the call from the default expression-statement case, and the
#if JS_HAS_LEXICAL_CLOSURE code in WellTerminated appears to have been to allow
'function f(){} function g(){}' for JS versions < 1.2, and to forbid it as an
error otherwise, requiring a semicolon in between the function declarations.
But in fact ECMA and good sense should allow as many function declarations on
a line as you please, optionally followed by other statements, and without
requiring semicolons after function declarations.

Since this change removes an error case, I don't expect any incompatibility
bugs to be reported.

- Coalescing/inlining WellTerminated meant removing its call from MatchLabel,
called by the break and continue cases in Statement.

- The debugger keyword could be used without a semicolon terminator to make it
a statement, as in 'debugger 1 + 2;', parsed as a debugger statement followed
by an expression statement -- which seems quite wrong (ECMA reserves debugger
but does not specify its usage).

This bug arose due to the early return at the end of the TOK_DEBUGGER case.
Although that case called WellTerminated, because it returned rather than broke
from the main switch, it failed to match an explicit semicolon terminator (if
present), making 'debugger; 1 + 2;' parse as three statements, with the first
semicolon becoming an empty statement (contrary to ECMA automatic semicolon
insertion rules).


git-svn-id: svn://10.0.0.236/trunk@150879 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-05 07:47:49 +00:00
brendan%mozilla.org
1a973e5f6d Use macroized version of dbaron's fix for >65535 line script parsing bug (229006, r=shaver).
git-svn-id: svn://10.0.0.236/trunk@150850 18797224-902f-48f8-a5cc-f745e15eee43
2004-01-03 18:19:51 +00:00
brendan%mozilla.org
853d5f2ee0 Fix SCRIPT_FIND_CATCH_START to cope with exceptions thrown from prolog bytecodes (206199, r=shaver, a=asa).
git-svn-id: svn://10.0.0.236/trunk@150794 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-31 02:53:02 +00:00
technutz%netscape.net
85802c6a61 MinGW bustage fix from bug 213910's landing. Patch by bsmedberg@covad.net. r=dbaron, sr=brendan
git-svn-id: svn://10.0.0.236/trunk@150778 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-30 17:53:17 +00:00
brendan%mozilla.org
b2008e8627 Don't JS_ReportOutOfMemory while holding script_filename_table_lock (r=self).
git-svn-id: svn://10.0.0.236/trunk@150775 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-30 07:54:09 +00:00
bsmedberg%covad.net
784122711d Bug 213910 - Implement Components.interfacesByID r=dbradley sr=jst
git-svn-id: svn://10.0.0.236/trunk@150757 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-28 04:37:57 +00:00
igor%mir2.org
53c690b7dd Cosmetics: removal of tabs left by the previous commit
git-svn-id: svn://10.0.0.236/trunk@150756 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-27 21:36:00 +00:00
igor%mir2.org
69ed31f693 Decompling parsing from code generation: compiler instances are created only when parsing tree is build.
git-svn-id: svn://10.0.0.236/trunk@150755 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-27 21:32:35 +00:00
igor%mir2.org
89e6cf3548 Initial patch to separate parsing from code generation: changing IRFactory so it can be created in Context.
git-svn-id: svn://10.0.0.236/trunk@150749 18797224-902f-48f8-a5cc-f745e15eee43
2003-12-27 09:53:57 +00:00