chakra-core / chakra-core/ChakraCore
Inconsistency when try to access an property inside the "with" scope
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
there's an inconsistence when we try to access an property inside the "with" scope.
OS: Ubuntu 16.04 x64
Chakra: 1.10.0.0-beta
Step to reproduce:
```
var o = { f: "foo" };
with (o) {
var desc = Object.getOwnPropertyDescriptor(this, "f");
function f() {
return "bar";
}
if (!(desc.value === undefined)) {
throw new Error('expected: undefined, got: ' + desc.value);
}
}
```
Actual results:
Error: expected: undefined, got: function f() {
return "bar";
}
Expected results:
Pass without failures
V8 and Spidermonkey pass as expected, but Chakra and JavascriptCore returns the function f() inside "with" scope.
Contributor guide
Research direction
Start by running the provided reproduction in ChakraCore on the reported behavior around JavaScript with scopes, then compare the result with V8 and SpiderMonkey as described. Done means the script passes without throwing and the property descriptor value is undefined, matching the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100