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 1450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1461 | 1461 |
1462 | 1462 |
1463 | 1463 |
1464 // Prototype (Object.getPrototypeOf, Object.prototype.isPrototypeOf). | 1464 // Prototype (Object.getPrototypeOf, Object.prototype.isPrototypeOf). |
1465 | 1465 |
1466 function TestPrototype() { | 1466 function TestPrototype() { |
1467 var o1 = {} | 1467 var o1 = {} |
1468 var p1 = Proxy.create({}) | 1468 var p1 = Proxy.create({}) |
1469 var p2 = Proxy.create({}, o1) | 1469 var p2 = Proxy.create({}, o1) |
1470 var p3 = Proxy.create({}, p2) | 1470 var p3 = Proxy.create({}, p2) |
1471 var p4 = Proxy.create({}, 666) | 1471 var p4 = Proxy.create({}, null) |
1472 var o2 = Object.create(p3) | 1472 var o2 = Object.create(p3) |
1473 | 1473 |
1474 assertSame(Object.getPrototypeOf(o1), Object.prototype) | 1474 assertSame(Object.getPrototypeOf(o1), Object.prototype) |
1475 assertSame(Object.getPrototypeOf(p1), null) | 1475 assertSame(Object.getPrototypeOf(p1), null) |
1476 assertSame(Object.getPrototypeOf(p2), o1) | 1476 assertSame(Object.getPrototypeOf(p2), o1) |
1477 assertSame(Object.getPrototypeOf(p3), p2) | 1477 assertSame(Object.getPrototypeOf(p3), p2) |
1478 assertSame(Object.getPrototypeOf(p4), null) | 1478 assertSame(Object.getPrototypeOf(p4), null) |
1479 assertSame(Object.getPrototypeOf(o2), p3) | 1479 assertSame(Object.getPrototypeOf(o2), p3) |
1480 | 1480 |
1481 assertTrue(Object.prototype.isPrototypeOf(o1)) | 1481 assertTrue(Object.prototype.isPrototypeOf(o1)) |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2157 | 2157 |
2158 TestIsEnumerableThrow(Proxy.create({ | 2158 TestIsEnumerableThrow(Proxy.create({ |
2159 get: function(pr, pk) { throw "myexn" } | 2159 get: function(pr, pk) { throw "myexn" } |
2160 })) | 2160 })) |
2161 | 2161 |
2162 TestIsEnumerableThrow(Proxy.create({ | 2162 TestIsEnumerableThrow(Proxy.create({ |
2163 get: function(pr, pk) { | 2163 get: function(pr, pk) { |
2164 return function(k) { throw "myexn" } | 2164 return function(k) { throw "myexn" } |
2165 } | 2165 } |
2166 })) | 2166 })) |
OLD | NEW |