IOS 6 javascript intermittent problems with object.defineProperty

Has anyone else noticed intermittent errors / problems in the new iOS 6 javascript engine when accessing object properties, where the property was defined using the new Object.defineProperty syntax?

https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/defineProperty

I see cases where javascript will not declare that undefined is not a function for object methods that are applied as properties of objects defined in this way.

+7
source share
2 answers

According to the Kangax ES5 table , "In some versions of WebKit, Object.defineProperty does not work with DOM objects." I guess this is what you can talk about. It notes # 2 at the bottom of the page. Hope this helps!

0
source

If you haven’t decided this yet, make sure that the specified property is enumerable (and configurable if necessary) ...

Object.defineProperty(obj, "key", { enumerable: true, configurable: true }); 
0
source

All Articles