| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../../resources/js-test.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 <script> | |
| 8 var div = document.createElement("div"); | |
| 9 shouldBeFalse('div.hasOwnProperty("id")'); | |
| 10 shouldBeTrue('div.__proto__.__proto__.__proto__.hasOwnProperty("id")'); | |
| 11 | |
| 12 var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'id'); | |
| 13 shouldBeTrue('desc.get instanceof Function'); | |
| 14 shouldBeTrue('desc.set instanceof Function'); | |
| 15 shouldBeTrue('desc.enumerable'); | |
| 16 shouldBeTrue('desc.configurable'); | |
| 17 | |
| 18 shouldThrow('xhr = new XMLHttpRequest(); xhr.__proto__ = HTMLDivElement.prototyp
e; xhr.id'); | |
| 19 shouldThrow('obj = Object.create(div); obj.id'); | |
| 20 | |
| 21 desc = Object.getOwnPropertyDescriptor(Element.prototype, 'id'); | |
| 22 shouldThrow('desc.get.call({})'); | |
| 23 | |
| 24 var a = document.createElement('a'); | |
| 25 shouldBeUndefined('desc.set.call(a, "abc")'); | |
| 26 shouldBeEqualToString('desc.get.call(a)', 'abc'); | |
| 27 </script> | |
| 28 </body> | |
| 29 </html> | |
| OLD | NEW |