Commit Graph

173 Commits

Author SHA1 Message Date
Jim Blandy
4ebb8ece60 Bug 514567: Detect duplicate property names. r=jorendorff 2009-11-19 12:35:55 -08:00
Jim Blandy
dccc422655 Bug 514576: Forbid 'with' statements in strict mode code. r=mrbkap 2009-11-19 09:49:00 -08:00
Jim Blandy
a1ea615b02 Bug 521868: Make code passed to a direct call to eval inherit the caller's strictness. r=jorendorff 2009-11-19 09:48:59 -08:00
Jim Blandy
34a27f0c88 Bug 514585: Recognize "use strict" directives. r=igor 2009-11-18 13:33:53 -08:00
Jim Blandy
ae0ff5874f Bug 514585: Remove macro wrappers for js_NewPrinter and JS_InitArenaPool. r=igor
These macros were intended to help avoid passing unused parameters
when JS_ARENAMETER is not defined, but they're not worth the trouble.
The unused parameter doesn't elicit warnings, and the performance
impact of passing the unneeded argument is negligible.

This also removes support for JS_ARENA_CONST_ALIGN_MASK, which is not
used.
2009-11-18 13:33:53 -08:00
Blake Kaplan
f0cd93b989 Bug 461170 - Detect when typeof is applied to an expression before constant folding so we correctly throw unbound name exceptions from the folded expression. r=brendan 2009-11-06 18:27:17 +01:00
Igor Bukanov
0d38a472cc bug 524346 - using jsval, not jsdouble *, for nan and +-oo. r=brendan 2009-10-28 14:57:31 +03:00
Igor Bukanov
8785797ba7 Backed out changeset 14c76164f4c2 - patch for bug 524346 caused test fails 2009-10-27 19:21:47 +03:00
Igor Bukanov
ed4f6edf7f bug 524346 - using jsval, not jsdouble *, for nan and +-oo. r=brendan 2009-10-27 13:26:57 +03:00
Jason Orendorff
e66886b51c Bug 515885 - Assertion failure: !scope->owned(), at ../jsobj.cpp. r=brendan. 2009-10-23 14:35:53 -05:00
Brendan Eich
9f9a05b0c3 Don't build a stack frame to execute empty scripts (516827, r=igor). 2009-10-18 17:41:24 -07:00
Jim Blandy
d87d9403e2 Bug 517990: Remove unused 'TS' parameter from NewNameNode and NewBindingNode. r=mrbkap 2009-10-08 10:29:03 -07:00
Jim Blandy
416f219573 Bug 515233: Move the TSF_DESTRUCTURING flag to the tree context. r=igor
The flag TSF_DESTRUCTURING is used by the parser to modify the way
variables in the destructuring pattern get represented in the parse
tree.  It is never set or used by the tokenizer.  This patch moves it
to JSTreeContext::flags, where it belongs, now that that field is wide
enough to hold it.

It also renames the flag TCF_DECL_DESTRUCTURING, since the flag is
only used for destructuring patterns that occur in declarations; it is
not set when processing assignment-like destructuring patterns.
2009-10-08 10:29:03 -07:00
Jim Blandy
f06be32d20 Bug 515233: Widen JSTreeContext::flags to 32 bits. r=igor
All the bits in this uint16 field are currently in use.  Adding bits
for projects like strict mode entails relocating existing flags, which
is additional work.  Furthermore, it seems that this has already
inspired people to put flags in places they don't belong:
TSF_DESTRUCTURING is a JSTokenStream flag, but is only used by the
parser.

This patch widens the field to 32 bits, and adjusts JSFunctionBox and
a few other places to match.

We should really replace these all with bitfields.
2009-10-08 10:29:03 -07:00
Jim Blandy
f4a407f114 Bug 515233: Make the static level its own parameter to JSCompiler::compileScript. r=igor
Pre-patch, the initial static level at which a script should be
compiled to run is passed in the upper sixteen bits of the tcflags
parameter to JSCompiler::compileScript; because JSTreeContext::tcflags
is a uint16, while the tcflags parameter is a uint32, we know the
parameter's upper bits are free.

However, we would like to enlarge JSTreeContext::tcflags to 32 bits,
as we already have a handful of new flags that belong there.  This
patch moves the static level to its own parameter, which has a default
argument.
2009-10-08 10:29:03 -07:00
Jim Blandy
0d6cdd1921 Bug 514585: Use bitfields in JSScript instead of a flag word. r=brendan
This is behavior-neutral cleanup in preparation for the real patch.
2009-10-08 10:29:03 -07:00
Jim Blandy
b101872320 Bug 514567: Fix error processing in PrimaryExpr. r=brendan
This code seems to assume that one can proceed if pn3 is NULL, but we
never check it again further down.  Instead, we create TOK_COLON nodes
whose left (and perhaps right) children are NULL.  It seems to me that
the TOK_RC case in js_EmitTree will choke on this.
2009-10-08 10:29:02 -07:00
Brendan Eich
2cf8dc9cf7 Remove now-redundant USE2DEF flags propagation before LinkUseToDef, which does it (510783 followup, r=mrbkap). 2009-09-17 19:44:24 -07:00
Brendan Eich
59ee053a5e Propagate USE2DEF flags in LinkUseToDef, duh (510783, r=mrbkap). 2009-09-17 18:56:23 -07:00
David Anderson
92ad5b2859 Renamed JSOP_LOOP to JSOP_TRACE, which now also gets emitted at the start of scripts (bug 515806, r=brendan). 2009-09-14 17:26:16 -07:00
Brendan Eich
79d774b114 Bug 515815 - TM: Regression on shell test case regress-452498-224.js (r=igor). 2009-09-11 10:47:47 -07:00
Brendan Eich
1cef550e73 Fix obvious thinko that bites Gary's fuzzer (515892, r=igor tomorrow, I trust). 2009-09-11 00:00:52 -07:00
Brendan Eich
016b0f207a Bug 514981 - JSStackFrame::sharp{Array,Depth} should be locals allocated due to #n[#=] usage (r=igor). 2009-09-09 20:21:15 -07:00
Jason Orendorff
e170e4b573 Bug 511728 - Misc. cleanup from bug 503080. r=igor.
--HG--
extra : rebase_source : f4b7b385bbece2316912ce67c77a49ac8fca6e5c
2009-09-09 15:53:37 -05:00
Brendan Eich
cce4dce512 Join lambdas assigned or initialized as methods to the compiler-created function object if we can, with a read barrier to clone on method value extractions other than call expressions (471214, r=jorendorff). 2009-09-03 14:41:19 -07:00
Andreas Gal
d4c110a6b1 Avoid bit twiddling on double values (513063, r=brendan). 2009-08-27 13:59:19 -07:00
Jason Orendorff
df3e3a355d Bug 510709 - Assertion failure: PN_TYPE(pn) == TOK_FUNCTION, at ../jsparse.cpp. r=brendan. 2009-08-27 12:28:28 -07:00
Brendan Eich
b063d31520 Back out changeset aff171a8c4f0 (bug 471214). 2009-08-26 09:34:41 -07:00
Brendan Eich
bd8f55c0ad Join function objects where possible (471214, r=igor). 2009-08-25 23:42:37 -07:00
David Anderson
e322e64001 Removed JSStackFrame::xmlNamespace (bug 512389, r=brendan). 2009-08-25 12:07:45 -07:00
Luke Wagner
3cf8a59c01 Bug 503952 - Use JSTempVector in scanner/parser; remove JSStringBuffer (r=brendan) 2009-08-14 16:10:59 -07:00
Jason Orendorff
d25d775501 Bug 510568 - Kill one last #if JS_HAS_LVALUE_RETURN directive. r=Waldo. 2009-08-15 07:21:06 -05:00
Igor Bukanov
7e607aac4d bug 495061 - js_PutArgsObject and js_PutCallObject that never fail. r=brendan 2009-08-14 20:43:16 +02:00
Jason Orendorff
8384b1e239 Bug 509098 - Remove JS_HAS_LVALUE_RETURN support. r=brendan. 2009-08-13 16:18:33 -05:00
Robert Sayre
c8a923e58e Merge mozilla-central to tracemonkey. 2009-08-12 12:18:38 -07:00
Jason Orendorff
335eeb15af Bug 461269 - Remove TOK_RP nodes from the parse tree. r=brendan. 2009-08-10 14:00:46 -05:00
Robert Sayre
99a0962393 Backed out changeset e09130fcb013 2009-07-28 18:51:35 -04:00
Brendan Eich
8d27b07ec5 Bug 471214 - Join function objects transparently, clone via read barrier to satisfy de-facto standard (r=igor). 2009-07-28 13:20:14 -07:00
Andreas Gal
e7f2714ea1 When finalizing, deallocate memory in a separate thread (505612, r=bent,brendan,waldo). 2009-07-27 21:10:12 -07:00
David Mandelin
cfb0d1fd1b Bug 506821: clean up trailing whitespace, r=brendan 2009-07-27 18:40:12 -07:00
Jason Orendorff
a31f80165c Bug 503080 - Remove prototype-scope-sharing. r=brendan. 2009-07-21 16:25:11 -05:00
Brendan Eich
4632276b25 Bug 499790 - common sub-expression elim for repeated (PND_ASSIGNED | PND_FUNARG), r=mrbkap. 2009-07-17 11:36:45 -07:00
Andreas Gal
f8892ed21b Shrink slots during GC only, split ReallocSlots into Alloc/Grow/ShrinkSlots (504478, r=igor). 2009-07-16 18:42:54 -07:00
David Anderson
a46f3aa0f0 Fix -0 modulo -x disagreement on Windows (bug 503595, r=sayrer). 2009-07-11 12:40:37 -07:00
Blake Kaplan
3cd1e79160 Bug 498993 - Don't mistake initialization for assignment when the assignment is hidden by a secon var declaration. r=brendan/jorendorff 2009-06-18 14:52:06 -07:00
Jason Orendorff
52fe5a97ba Bug 497618 - Change JSString macros to methods. r=Waldo. 2009-06-10 20:29:44 -05:00
Jason Orendorff
45de8e01db Bug 498395 - "Assertion failure: !(pn->pn_dflags & flag), at ../jsparse.h". r=mrbkap, r=brendan.
--HG--
extra : rebase_source : c3d0ecfcbbbce0c7494ffd53dc240c2b69e6eb8f
2009-06-15 15:42:00 -05:00
Brendan Eich
1bd5c5dc73 Over-parenthesize per house style and to avoid GCC warning (r=nnethercote, private communication). 2009-06-14 19:37:43 -07:00
Brendan Eich
51fe52e6f9 Wrapper automation should not apply to flat closures, plus cleanup (496790, r=igor). 2009-06-09 00:51:02 -07:00
Brendan Eich
a08c609235 Fix destructuring binding to follow the cheezy dominance relation rules of the upvar analysis (496134, r=mrbkap; take 2). 2009-06-08 13:03:50 -07:00