Created
November 17, 2011 22:24
-
-
Save aadsm/1374750 to your computer and use it in GitHub Desktop.
Object.defineProperty bug in IE10 (10.0.8102.0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!doctype html> | |
| <!-- | |
| runnable version: http://jsfiddle.net/uVkHh/ | |
| Expected result: | |
| Super.foo | |
| foo: { | |
| "value": "this.foo", | |
| "writable": false, | |
| "enumerable": false, | |
| "configurable": false | |
| } | |
| this.foo | |
| Current result: | |
| Super.foo | |
| foo: { | |
| "value": "this.foo", | |
| "writable": false, | |
| "enumerable": false, | |
| "configurable": false | |
| } | |
| Super.foo | |
| --> | |
| <script> | |
| var Super = Object.create(Object.prototype, { | |
| foo: { | |
| configurable: true, | |
| get: function() { | |
| Object.defineProperty(this, "foo", { | |
| value: "this.foo" | |
| }); | |
| return "Super.foo"; | |
| }, | |
| set: function() {} | |
| } | |
| }); | |
| var o = Object.create(Super); | |
| console.log("o.foo: " + o.foo); | |
| console.log("foo descriptor: ", JSON.stringify(Object.getOwnPropertyDescriptor(o, "foo"), null, " ")); | |
| console.log("o.foo: " + o.foo); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment