chakra-core / chakra-core/ChakraCore

Super property access in eval cases should throw SyntaxError not runtime error

Open
#5,559 4 comments 1 reaction 0 assignees View on GitHub
Bug Severity: 3
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Following up on the discussion in this PR https://github.com/Microsoft/ChakraCore/pull/5471. Right now for eval cases we always assume superpopertyallowed status and then throw a runtime error for error cases. Ideally is should be a Syntax Error.

```js
function foo() {
print(eval("print('Inside eval');super.a"));
}
foo();
```

This shouldn't print 'Inside eval' at all. We should only get a SyntaxError.

edit:formatting

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.