[Webkit-unassigned] [Bug 105922] CommaExpression with 'arguments' as last expression throws SyntaxError instead of ReferenceError

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 7 11:45:33 PST 2013


https://bugs.webkit.org/show_bug.cgi?id=105922





--- Comment #2 from André Bargull <andre.bargull at gmail.com>  2013-01-07 11:47:28 PST ---
Per [11.13.1] a SyntaxError is thrown iff
- Type(lref) is Reference is true
- IsStrictReference(lref) is true
- Type(GetBase(lref)) is Environment Record
- GetReferencedName(lref) is either "eval" or "arguments"


In the expression `(1,arguments)=0`, `Type(lref)` is not a Reference, but a value, therefore the strict-mode assignment to arguments rule in [11.13.1] does not apply, hence no SyntaxError. That means step 5 of [11.13.1] gets executed, PutValue(V,W) [8.7.2] will be called and then a ReferenceError gets thrown in step 1 of [8.7.2]. Per [16 Errors], the assignment `(1,arguments)=0` should result in an early error (with type ReferenceError? The spec does not mandate a specific error..?), but early errors for assignments are not implemented in JSC. (Strict mode is irrelevant for early errors in assignment expressions if the left-hand-side is not of type reference.)

As of now, the supplied test case results in an early SyntaxError.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list