OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/testharness.js"></script> |
| 3 <script src="../../../resources/testharnessreport.js"></script> |
| 4 <script> |
| 5 test(function() { |
| 6 assert_equals(HTMLElement.toString(), "function HTMLElement() { [native
code] }"); |
| 7 assert_equals(HTMLElement.toString, Function.prototype.toString); |
| 8 }, "HTMLElement.toString should be Function.prototype.toString"); |
| 9 |
| 10 test(function() { |
| 11 assert_equals(HTMLElement.toString.toString(), "function toString() { [n
ative code] }"); |
| 12 assert_equals(HTMLElement.toString.toString, Function.prototype.toString
); |
| 13 }, "HTMLElement.toString.toString should be Function.prototype.toString"); |
| 14 |
| 15 HTMLElement.toString.toString = function() { return "foobar"; } |
| 16 |
| 17 test(function() { |
| 18 assert_equals(HTMLElement.toString.toString(), "foobar"); |
| 19 assert_equals(HTMLElement.toString(), "function HTMLElement() { [native
code] }"); |
| 20 assert_equals(HTMLElement.toString, Function.prototype.toString); |
| 21 }, "After changing HTMLElement.toString.toString, HTMLElement.toString shoul
d still be Function.prototype.toString"); |
| 22 |
| 23 test(function() { |
| 24 assert_equals(HTMLDivElement.toString.toString(), "foobar"); |
| 25 assert_equals(HTMLDivElement.toString(), "function HTMLDivElement() { [n
ative code] }"); |
| 26 assert_equals(HTMLDivElement.toString, Function.prototype.toString); |
| 27 }, "After changing HTMLElement.toString.toString, HTMLDivElement.toString sh
ould still be Function.prototype.toString"); |
| 28 </script> |
OLD | NEW |