The following code:
let a = {}
Object.defineProperty(a, 'someProp', {
get() {
return 42
}
})
Did I do something wrong or is it a bug?
```
2: Object.defineProperty(a, 'someProp', {
^ Object.defineProperty. Property not found in
2: Object.defineProperty(a, 'someProp', {
^ object literal
Related: #4742 (Object.create) as well as #285 (from 2015!)
Pointing to this comment especially, too: https://github.com/facebook/flow/issues/4742#issuecomment-326088108
The definition has been updated in the JS lib, but it looks like value is still special-cased somewhere in the ML code.
Most helpful comment
Sure it's a bug.
See this poor definition.
I tried to improve at a bit (not enough for your case though) but with no success: maintainers are not too fast.