Index: LayoutTests/fast/dom/dom-attribute-on-prototype-chain.html |
diff --git a/LayoutTests/fast/dom/dom-attribute-on-prototype-chain.html b/LayoutTests/fast/dom/dom-attribute-on-prototype-chain.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ffc87458f632caf0844312690bc6e0b03b40159b |
--- /dev/null |
+++ b/LayoutTests/fast/dom/dom-attribute-on-prototype-chain.html |
@@ -0,0 +1,29 @@ |
+<!DOCTYPE html> |
+<html> |
+<head> |
+<script src="../../resources/js-test.js"></script> |
+</head> |
+<body> |
+<script> |
+var div = document.createElement("div"); |
+shouldBeFalse('div.hasOwnProperty("id")'); |
+shouldBeTrue('div.__proto__.__proto__.__proto__.hasOwnProperty("id")'); |
arv (Not doing code reviews)
2014/12/08 14:56:50
Lets make these tests more explicit:
assert.equal
|
+ |
+var desc = Object.getOwnPropertyDescriptor(Element.prototype, 'id'); |
+shouldBeTrue('desc.get instanceof Function'); |
arv (Not doing code reviews)
2014/12/08 14:56:50
instanceof is another non explicit test. In this c
|
+shouldBeTrue('desc.set instanceof Function'); |
+shouldBeTrue('desc.enumerable'); |
+shouldBeTrue('desc.configurable'); |
+ |
+shouldThrow('xhr = new XMLHttpRequest(); xhr.__proto__ = HTMLDivElement.prototype; xhr.id'); |
+shouldThrow('obj = Object.create(div); obj.id'); |
+ |
+desc = Object.getOwnPropertyDescriptor(Element.prototype, 'id'); |
+shouldThrow('desc.get.call({})'); |
+ |
+var a = document.createElement('a'); |
+shouldBeUndefined('desc.set.call(a, "abc")'); |
+shouldBeEqualToString('desc.get.call(a)', 'abc'); |
+</script> |
+</body> |
+</html> |