| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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 // MODULE | 5 // MODULE |
| 6 | 6 |
| 7 let ja = 42; | 7 let ja = 42; |
| 8 export {ja as yo}; | 8 export {ja as yo}; |
| 9 export const bla = "blaa"; | 9 export const bla = "blaa"; |
| 10 export {foo as foo_again}; | 10 export {foo as foo_again}; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 assertEquals( | 25 assertEquals( |
| 26 ["bla", "foo_again", "yo", Symbol.toStringTag, Symbol.iterator], | 26 ["bla", "foo_again", "yo", Symbol.toStringTag, Symbol.iterator], |
| 27 Reflect.ownKeys(foo)); | 27 Reflect.ownKeys(foo)); |
| 28 | 28 |
| 29 // Its "yo" property. | 29 // Its "yo" property. |
| 30 assertEquals( | 30 assertEquals( |
| 31 {value: 42, enumerable: true, configurable: false, writable: true}, | 31 {value: 42, enumerable: true, configurable: false, writable: true}, |
| 32 Reflect.getOwnPropertyDescriptor(foo, "yo")); | 32 Reflect.getOwnPropertyDescriptor(foo, "yo")); |
| 33 assertFalse(Reflect.deleteProperty(foo, "yo")); | 33 assertFalse(Reflect.deleteProperty(foo, "yo")); |
| 34 assertTrue(Reflect.has(foo, "yo")); | 34 assertTrue(Reflect.has(foo, "yo")); |
| 35 // TODO(neis): The next three should be False. | 35 assertFalse(Reflect.set(foo, "yo", true)); |
| 36 assertTrue(Reflect.set(foo, "yo", true)); | 36 // TODO(neis): The next two should be False. |
| 37 assertTrue(Reflect.defineProperty(foo, "yo", | 37 assertTrue(Reflect.defineProperty(foo, "yo", |
| 38 Reflect.getOwnPropertyDescriptor(foo, "yo"))); | 38 Reflect.getOwnPropertyDescriptor(foo, "yo"))); |
| 39 assertTrue(Reflect.defineProperty(foo, "yo", {})); | 39 assertTrue(Reflect.defineProperty(foo, "yo", {})); |
| 40 assertFalse(Reflect.defineProperty(foo, "yo", {get() {return 1}})); | 40 assertFalse(Reflect.defineProperty(foo, "yo", {get() {return 1}})); |
| 41 assertEquals(42, Reflect.get(foo, "yo")); | 41 assertEquals(42, Reflect.get(foo, "yo")); |
| 42 assertEquals(43, (ja++, foo.yo)); | 42 assertEquals(43, (ja++, foo.yo)); |
| 43 | 43 |
| 44 // Its "foo_again" property. | 44 // Its "foo_again" property. |
| 45 assertSame(foo, foo.foo_again); | 45 assertSame(foo, foo.foo_again); |
| 46 | 46 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 assertFalse(Reflect.has(foo, key)); | 98 assertFalse(Reflect.has(foo, key)); |
| 99 } | 99 } |
| 100 | 100 |
| 101 // The actual star import that we are testing. Namespace imports are | 101 // The actual star import that we are testing. Namespace imports are |
| 102 // initialized before evaluation. | 102 // initialized before evaluation. |
| 103 import * as foo from "modules-namespace1.js"; | 103 import * as foo from "modules-namespace1.js"; |
| 104 | 104 |
| 105 // There can be only one namespace object. | 105 // There can be only one namespace object. |
| 106 import * as bar from "modules-namespace1.js"; | 106 import * as bar from "modules-namespace1.js"; |
| 107 assertSame(foo, bar); | 107 assertSame(foo, bar); |
| OLD | NEW |