chakra-core / chakra-core/ChakraCore

LHS should be evaluated first in the assignment.

Open
#1,745 6 comments 0 reactions 1 assignee Claimed by @pleath View on GitHub
Bug Compatibility Severity: 3
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

``` js
(function() {
var x = 1;
(function() {
x = (eval('var x = 20'), 2);
console.log(x == 20); // this should be true
})();
console.log(x == 2); // this should be true
})();
```

Both should print `true`. (Edge/Chrome don't but Firefox does)
see https://tc39.github.io/ecma262/#sec-assignment-operators-runtime-semantics-evaluation

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.