chakra-core / chakra-core/ChakraCore
Wrong Realization of String.prototype.toLocaleLowerCase
- Dominant language
- JavaScript
- Stars
- 9.3k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
Running code in ch version 1.11.9.0, the output is different from other js engines.
code:
```
let val = 10;
let handler_1 = {
get: function(oTarget, sKey) {
if (sKey.toString() == 'length') {
print("in get length");
val = 1;
}
return Reflect.get(oTarget, sKey);
},
};
let p_1 = new Proxy({}, handler_1);
var newStr = String.prototype.toLocaleLowerCase.call({}, p_1);
print("BT_FLAG");
print(val);
```
Output of sm, v8, jsc:
```
in get length
BT_FLAG
1
```
Output of ch:
```
BT_FLAG
10
```
In the specification(https://tc39.github.io/ecma402/#sec-canonicalizelocalelist), Get(locales, “length”) shows that we can use Proxy to trap 'get length',
BT group
2019.6.24
Contributor guide
Assessment
This issue has not been assessed yet.