test262: Completion values for control flow do not match the spec
[WebKit-https.git] / LayoutTests / js / lookupGetterGetter-native-bindings.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <div id="testDiv"></div>
8 <script>
9 description("Checks that __lookupGetter__ / __lookupSetter__() works for native bindings.");
10
11 var testDiv = document.getElementById("testDiv");
12
13 shouldBeType("Element.prototype.__lookupGetter__('tagName')", "Function");
14 shouldBeUndefined("Element.prototype.__lookupSetter__('tagName')");
15 shouldBe("Element.prototype.__lookupGetter__('tagName')", "Object.getOwnPropertyDescriptor(Element.prototype, 'tagName').get");
16 shouldBe("Element.prototype.__lookupSetter__('tagName')", "Object.getOwnPropertyDescriptor(Element.prototype, 'tagName').set");
17 shouldBeEqualToString("testDiv.tagName", "DIV");
18 shouldBeEqualToString("Element.prototype.__lookupGetter__('tagName').call(testDiv)", "DIV");
19
20 debug("");
21 shouldBeType("Element.prototype.__lookupGetter__('nodeName')", "Function");
22 shouldBeUndefined("Element.prototype.__lookupSetter__('nodeName')");
23 shouldBe("Element.prototype.__lookupGetter__('nodeName')", "Object.getOwnPropertyDescriptor(Node.prototype, 'nodeName').get");
24 shouldBe("Element.prototype.__lookupSetter__('nodeName')", "Object.getOwnPropertyDescriptor(Node.prototype, 'nodeName').set");
25 shouldBeEqualToString("testDiv.nodeName", "DIV");
26 shouldBeEqualToString("Element.prototype.__lookupGetter__('nodeName').call(testDiv)", "DIV");
27
28 debug("");
29 shouldBeType("HTMLElement.prototype.__lookupGetter__('innerText')", "Function");
30 shouldBeType("HTMLElement.prototype.__lookupSetter__('innerText')", "Function");
31 shouldBeType("HTMLDivElement.prototype.__lookupGetter__('innerText')", "Function");
32 shouldBeType("HTMLDivElement.prototype.__lookupSetter__('innerText')", "Function");
33 shouldBeType("testDiv.__proto__.__lookupGetter__('innerText')", "Function");
34 shouldBeType("testDiv.__proto__.__lookupSetter__('innerText')", "Function");
35 shouldBeType("testDiv.__proto__.__proto__.__lookupGetter__('innerText')", "Function");
36 shouldBeType("testDiv.__proto__.__proto__.__lookupSetter__('innerText')", "Function");
37 shouldBe("HTMLElement.prototype.__lookupGetter__('innerText')", "Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'innerText').get");
38 shouldBe("HTMLElement.prototype.__lookupSetter__('innerText')", "Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'innerText').set");
39 shouldBeEqualToString("testDiv.innerText", "");
40 shouldBeEqualToString("HTMLElement.prototype.__lookupGetter__('innerText').call(testDiv)", "");
41 evalAndLog("testDiv.innerText = 'TEST1'");
42 shouldBeEqualToString("testDiv.innerText", "TEST1");
43 shouldBeEqualToString("HTMLElement.prototype.__lookupGetter__('innerText').call(testDiv)", "TEST1");
44 evalAndLog("HTMLElement.prototype.__lookupSetter__('innerText').call(testDiv, '')");
45 shouldBeEqualToString("testDiv.innerText", "");
46 shouldBeEqualToString("HTMLElement.prototype.__lookupGetter__('innerText').call(testDiv)", "");
47 </script>
48 <script src="../resources/js-test-post.js"></script>
49 </body>
50 </html>