chakra-core / chakra-core/ChakraCore
Error not thrown when calling eval() on an assignment expression that is not valid in strict mode within a computed property name within a class
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
#5477 showed that ChakraCore does not throw an error when an assignment expression that is not allowed in strict mode is used as the computed property name of a member function within a class.
#5689 fixed many cases that arise from the issue stated above.
A case that is not fixed is when the invalid strict mode assignment expression is within a call to eval:
```
class C {
[eval("a = 5")]() { }
}
```
Testing against other engines:
```
eshost -x -t bug.js
┌─────────┬─────────────────────────────────────────────────────┐
│ jsvu-ch │ │
├─────────┼─────────────────────────────────────────────────────┤
│ jsvu-d8 │ │
│ │ ReferenceError: a is not defined │
├─────────┼─────────────────────────────────────────────────────┤
│ jsvu-sm │ │
│ │ ReferenceError: assignment to undeclared variable a │
└─────────┴─────────────────────────────────────────────────────┘
Contributor guide
Assessment
This issue has not been assessed yet.