« Bugzilla Issues Index

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

Created attachment 7

According to section 11.13.1

AssignmentExpression : LeftHandSideExpression = AssignmentExpression

11.13.1-1-1, NumericLiteral
11.13.1-1-2, StringLiteral
11.13.1-1-3 BooleanLiteral
11.13.1-1-4 NullLiteral

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.

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:)