chakra-core / ChakraCore

ChakraCore is an open source Javascript engine with a C API.
MIT License
9.12k stars 1.2k forks source link

ChakraCore allows writing to a non-writable, non-configurable property through Annex B 3.3 edge case #2828

Open littledan opened 7 years ago

littledan commented 7 years ago

Test case:

Object.defineProperty(this, 'f', {})
eval('{function f() {}}')
print(Object.getOwnPropertyDescriptor(this, 'f').value)

ChakraCore outputs the function, whereas three other engines output undefined. ChakraCore ignored the fact that the property was non-writable and non-configurable to get this output.

Cellule commented 7 years ago

@curtisman Could you help triage this please ?

dilijev commented 7 years ago

Confirmed in 2.0 and master:

#### d8, sm, node
undefined
#### node-ch
[Function: f]
#### ch-master, ch-2.0
function f() {}