OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1623 | 1623 |
1624 function TestPropertyNames2(create, handler, names) { | 1624 function TestPropertyNames2(create, handler, names) { |
1625 var p = create(handler) | 1625 var p = create(handler) |
1626 assertArrayEquals(names, Object.getOwnPropertyNames(p)) | 1626 assertArrayEquals(names, Object.getOwnPropertyNames(p)) |
1627 } | 1627 } |
1628 | 1628 |
1629 TestPropertyNames([], { | 1629 TestPropertyNames([], { |
1630 getOwnPropertyNames: function() { return [] } | 1630 getOwnPropertyNames: function() { return [] } |
1631 }) | 1631 }) |
1632 | 1632 |
1633 TestPropertyNames(["a", "zz", " ", "0"], { | 1633 TestPropertyNames(["a", "zz", " ", "0", "toString"], { |
1634 getOwnPropertyNames: function() { return ["a", "zz", " ", 0] } | 1634 getOwnPropertyNames: function() { return ["a", "zz", " ", 0, "toString"] } |
1635 }) | 1635 }) |
1636 | 1636 |
1637 TestPropertyNames(["throw", "function "], { | 1637 TestPropertyNames(["throw", "function "], { |
1638 getOwnPropertyNames: function() { return this.getOwnPropertyNames2() }, | 1638 getOwnPropertyNames: function() { return this.getOwnPropertyNames2() }, |
1639 getOwnPropertyNames2: function() { return ["throw", "function "] } | 1639 getOwnPropertyNames2: function() { return ["throw", "function "] } |
1640 }) | 1640 }) |
1641 | 1641 |
1642 TestPropertyNames(["[object Object]"], { | 1642 TestPropertyNames(["[object Object]"], { |
1643 get getOwnPropertyNames() { | 1643 get getOwnPropertyNames() { |
1644 return function() { return [{}] } | 1644 return function() { return [{}] } |
(...skipping 26 matching lines...) Expand all Loading... |
1671 | 1671 |
1672 function TestKeys2(create, handler, names) { | 1672 function TestKeys2(create, handler, names) { |
1673 var p = create(handler) | 1673 var p = create(handler) |
1674 assertArrayEquals(names, Object.keys(p)) | 1674 assertArrayEquals(names, Object.keys(p)) |
1675 } | 1675 } |
1676 | 1676 |
1677 TestKeys([], { | 1677 TestKeys([], { |
1678 keys: function() { return [] } | 1678 keys: function() { return [] } |
1679 }) | 1679 }) |
1680 | 1680 |
1681 TestKeys(["a", "zz", " ", "0"], { | 1681 TestKeys(["a", "zz", " ", "0", "toString"], { |
1682 keys: function() { return ["a", "zz", " ", 0] } | 1682 keys: function() { return ["a", "zz", " ", 0, "toString"] } |
1683 }) | 1683 }) |
1684 | 1684 |
1685 TestKeys(["throw", "function "], { | 1685 TestKeys(["throw", "function "], { |
1686 keys: function() { return this.keys2() }, | 1686 keys: function() { return this.keys2() }, |
1687 keys2: function() { return ["throw", "function "] } | 1687 keys2: function() { return ["throw", "function "] } |
1688 }) | 1688 }) |
1689 | 1689 |
1690 TestKeys(["[object Object]"], { | 1690 TestKeys(["[object Object]"], { |
1691 get keys() { | 1691 get keys() { |
1692 return function() { return [{}] } | 1692 return function() { return [{}] } |
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2269 function TestConstructorWithProxyPrototype2(create, handler) { | 2269 function TestConstructorWithProxyPrototype2(create, handler) { |
2270 function C() {}; | 2270 function C() {}; |
2271 C.prototype = create(handler); | 2271 C.prototype = create(handler); |
2272 | 2272 |
2273 var o = new C; | 2273 var o = new C; |
2274 assertSame(C.prototype, o.__proto__); | 2274 assertSame(C.prototype, o.__proto__); |
2275 assertSame(C.prototype, Object.getPrototypeOf(o)); | 2275 assertSame(C.prototype, Object.getPrototypeOf(o)); |
2276 } | 2276 } |
2277 | 2277 |
2278 TestConstructorWithProxyPrototype(); | 2278 TestConstructorWithProxyPrototype(); |
OLD | NEW |