dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.2k stars 1.57k forks source link

_getJsProxy defined by dart:js should use hasOwnProperty #16199

Closed mraleph closed 9 years ago

mraleph commented 10 years ago

var jsProxy = JS('', '#[#]', o, propertyName);

_getJsProxy attempts to cache proxy on the object itself. However to probe if there is a cached proxy it uses normal o[propertyName] access which traverses prototype chain.

If prototype of the object was proxied this probe will return proxy cached on the prototype leading to hard to debug bugs.

Probe should either use getOwnPropertyDescriptor or be guarded with hasOwnProperty.

mraleph commented 10 years ago

Fix under review https://codereview.chromium.org/138723006


cc @justinfagnani. Added Started label.

mraleph commented 10 years ago

Set owner to @mraleph.

mraleph commented 10 years ago

Should be fixed by r32244.


Added Fixed label.