Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: test/mjsunit/modules-namespace1.js

Issue 2603193002: [modules] Make @@toStringTag on namespace objects non-configurable. (Closed)
Patch Set: Skip test262 tests and add 'delete' test. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/bootstrapper.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 28 matching lines...) Expand all
39 assertEquals(42, Reflect.get(foo, "yo")); 39 assertEquals(42, Reflect.get(foo, "yo"));
40 assertEquals(43, (ja++, foo.yo)); 40 assertEquals(43, (ja++, foo.yo));
41 41
42 // Its "foo_again" property. 42 // Its "foo_again" property.
43 assertSame(foo, foo.foo_again); 43 assertSame(foo, foo.foo_again);
44 44
45 // Its @@toStringTag property. 45 // Its @@toStringTag property.
46 assertTrue(Reflect.has(foo, Symbol.toStringTag)); 46 assertTrue(Reflect.has(foo, Symbol.toStringTag));
47 assertEquals("string", typeof Reflect.get(foo, Symbol.toStringTag)); 47 assertEquals("string", typeof Reflect.get(foo, Symbol.toStringTag));
48 assertEquals( 48 assertEquals(
49 {value: "Module", configurable: true, writable: false, enumerable: false}, 49 {value: "Module", configurable: false, writable: false, enumerable: false},
50 Reflect.getOwnPropertyDescriptor(foo, Symbol.toStringTag)); 50 Reflect.getOwnPropertyDescriptor(foo, Symbol.toStringTag));
51 51 // TODO(neis): Spec currently says the next one should return true.
52 // TODO(neis): Clarify spec w.r.t. other symbols. 52 assertFalse(Reflect.deleteProperty(foo, Symbol.toStringTag));
53 53
54 // Nonexistant properties. 54 // Nonexistant properties.
55 let nonexistant = ["gaga", 123, Symbol('')]; 55 let nonexistant = ["gaga", 123, Symbol('')];
56 for (let key of nonexistant) { 56 for (let key of nonexistant) {
57 assertSame(undefined, Reflect.getOwnPropertyDescriptor(foo, key)); 57 assertSame(undefined, Reflect.getOwnPropertyDescriptor(foo, key));
58 assertTrue(Reflect.deleteProperty(foo, key)); 58 assertTrue(Reflect.deleteProperty(foo, key));
59 assertFalse(Reflect.set(foo, key, true)); 59 assertFalse(Reflect.set(foo, key, true));
60 assertSame(undefined, Reflect.get(foo, key)); 60 assertSame(undefined, Reflect.get(foo, key));
61 assertFalse(Reflect.defineProperty(foo, key, {get() {return 1}})); 61 assertFalse(Reflect.defineProperty(foo, key, {get() {return 1}}));
62 assertFalse(Reflect.has(foo, key)); 62 assertFalse(Reflect.has(foo, key));
63 } 63 }
64 64
65 // The actual star import that we are testing. Namespace imports are 65 // The actual star import that we are testing. Namespace imports are
66 // initialized before evaluation. 66 // initialized before evaluation.
67 import * as foo from "modules-namespace1.js"; 67 import * as foo from "modules-namespace1.js";
68 68
69 // There can be only one namespace object. 69 // There can be only one namespace object.
70 import * as bar from "modules-namespace1.js"; 70 import * as bar from "modules-namespace1.js";
71 assertSame(foo, bar); 71 assertSame(foo, bar);
OLDNEW
« no previous file with comments | « src/bootstrapper.cc ('k') | test/test262/test262.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698