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

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

Issue 2405603003: [modules] Extend a namespace test. (Closed)
Patch Set: Created 4 years, 2 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/factory.cc ('k') | no next file » | 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 import * as foo from "modules-namespace4.js"; 7 import * as foo from "modules-namespace4.js";
8 8
9 assertSame(undefined, a); 9 assertSame(undefined, a);
10 assertThrows(() => b, ReferenceError); 10 assertThrows(() => b, ReferenceError);
11 assertThrows(() => B, ReferenceError);
11 assertThrows(() => c, ReferenceError); 12 assertThrows(() => c, ReferenceError);
12 assertEquals(45, d()); 13 assertEquals(45, d());
13 14
14 assertSame(undefined, foo.a); 15 assertSame(undefined, foo.a);
15 assertThrows(() => foo.b, ReferenceError); 16 assertThrows(() => foo.b, ReferenceError);
17 assertThrows(() => foo.B, ReferenceError);
16 assertThrows(() => foo.c, ReferenceError); 18 assertThrows(() => foo.c, ReferenceError);
17 assertEquals(45, foo.d()); 19 assertEquals(45, foo.d());
18 assertThrows(() => foo.default, ReferenceError); 20 assertThrows(() => foo.default, ReferenceError);
19 assertSame(undefined, foo.doesnotexist); 21 assertSame(undefined, foo.doesnotexist);
20 22
23 Function("Foo", " \
24 with (Foo) { \
25 assertEquals(undefined, a); \
26 assertThrows(() => b, ReferenceError); \
27 assertThrows(() => B, ReferenceError); \
28 assertThrows(() => c, ReferenceError); \
29 assertEquals(45, d()); \
30 }")(foo);
31
21 export var a = 42; 32 export var a = 42;
22 export let b = 43; 33 export let b = 43;
34 export {b as B};
23 export const c = 44; 35 export const c = 44;
24 export function d() { return 45 }; 36 export function d() { return 45 };
25 export default 46; 37 export default 46;
26 38
27 assertEquals(42, a); 39 assertEquals(42, a);
28 assertEquals(43, b); 40 assertEquals(43, b);
29 assertEquals(44, c); 41 assertEquals(44, c);
30 assertEquals(45, d()); 42 assertEquals(45, d());
31 43
32 assertEquals(42, foo.a); 44 assertEquals(42, foo.a);
33 assertEquals(43, foo.b); 45 assertEquals(43, foo.b);
46 assertEquals(43, foo.B);
34 assertEquals(44, foo.c); 47 assertEquals(44, foo.c);
35 assertEquals(45, foo.d()); 48 assertEquals(45, foo.d());
36 assertEquals(46, foo.default); 49 assertEquals(46, foo.default);
37 assertSame(undefined, foo.doesnotexist); 50 assertSame(undefined, foo.doesnotexist);
51
52 Function("Foo", " \
53 with (Foo) { \
54 assertEquals(42, a); \
55 assertEquals(43, b); \
56 assertEquals(43, B); \
57 assertEquals(44, c); \
58 assertEquals(45, d()); \
59 }")(foo);
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698