| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --allow-natives-syntax --harmony-regexp-subclass | 5 // Flags: --allow-natives-syntax --expose-gc |
| 6 // Flags: --expose-gc | |
| 7 | 6 |
| 8 "use strict"; | 7 "use strict"; |
| 9 | 8 |
| 10 | 9 |
| 11 function checkPrototypeChain(object, constructors) { | 10 function checkPrototypeChain(object, constructors) { |
| 12 var proto = object.__proto__; | 11 var proto = object.__proto__; |
| 13 for (var i = 0; i < constructors.length; i++) { | 12 for (var i = 0; i < constructors.length; i++) { |
| 14 assertEquals(constructors[i].prototype, proto); | 13 assertEquals(constructors[i].prototype, proto); |
| 15 assertEquals(constructors[i], proto.constructor); | 14 assertEquals(constructors[i], proto.constructor); |
| 16 proto = proto.__proto__; | 15 proto = proto.__proto__; |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 922 // TODO(littledan): Is the RegExp constructor correct to create | 921 // TODO(littledan): Is the RegExp constructor correct to create |
| 923 // the internal slots and do these type checks this way? | 922 // the internal slots and do these type checks this way? |
| 924 assertEquals("biep", %_RegExpSource(o)); | 923 assertEquals("biep", %_RegExpSource(o)); |
| 925 assertThrows(() => Object.getOwnPropertyDescriptor(RegExp.prototype, | 924 assertThrows(() => Object.getOwnPropertyDescriptor(RegExp.prototype, |
| 926 'source').get(o), | 925 'source').get(o), |
| 927 TypeError); | 926 TypeError); |
| 928 assertEquals("/undefined/undefined", RegExp.prototype.toString.call(o)); | 927 assertEquals("/undefined/undefined", RegExp.prototype.toString.call(o)); |
| 929 assertTrue(o.__proto__ === p2); | 928 assertTrue(o.__proto__ === p2); |
| 930 assertTrue(f.prototype === p3); | 929 assertTrue(f.prototype === p3); |
| 931 })(); | 930 })(); |
| OLD | NEW |