Closed Bug 1799290 Opened 3 years ago Closed 3 years ago

Order of writing property to global this in strict mode

Categories

(Core :: JavaScript Engine, defect)

Firefox 107
defect

Tracking

()

RESOLVED DUPLICATE of bug 605515

People

(Reporter: f52985, Unassigned)

Details

Steps to reproduce:

Execute the program below using jsshell

"use strict";
x = this.x = 0;

Actual results:

No exception is thrown.

Expected results:

ReferenceError

should be thrown.

According to the ECMA-262 specification's runtime semantics of AssignmentExpression (https://tc39.es/ecma262/#sec-assignment-operators-runtime-semantics-evaluation), the evaluation of LeftHandSideExpression is performed first at step 1.a, which results in an unresolvable reference. Then, when the PutValue is performed at step 1.d, it should result in ReferenceError, since the reference passed to the PutValue algorithm is still unresolvable, regardless of the evaluation result of right hand side.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Duplicate of bug: 605515
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.