archives

« Bugzilla Issues Index

#217 — from 11.13.1-1-1 to 11.13.1-1-4 should raise SyntaxError (not ReferenceError)


Created attachment 7
patch

According to section 11.13.1
http://es5.github.com/#x11.13.1

AssignmentExpression : LeftHandSideExpression = AssignmentExpression

and,
11.13.1-1-1, NumericLiteral
42
11.13.1-1-2, StringLiteral
'x'
11.13.1-1-3 BooleanLiteral
true
11.13.1-1-4 NullLiteral
null

doesn't return Reference. And 11.13.1, step 4
4. Throw a SyntaxError exception if the following conditions are all true:
Type(lref) is Reference is true
IsStrictReference(lref) is true
Type(GetBase(lref)) is Environment Record
GetReferencedName(lref) is either "eval" or "arguments"

Then, Type(lref) is not Reference, so should raise SyntaxError as early error in parse phase.


The key to step 4 of 11.13.1 is:
"IsStrictReference(lref) is true"


From 8.7:
"IsStrictReference(V). Returns the strict reference component of the reference V."

In turn, I believe strict reference has to do with strict mode, and am double-checking this assumption with the es-discuss alias. If it is, the test case is valid as PutValue (section 8.7.2) is throwing the ReferenceError.


Thanks.
Oh sorry about my error. I misunderstood this step 4. Your indication is right!


Never heard back from anyone on es-discuss, but I'm fairly certain this interpretation is correct:)