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

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

Issue 2388153003: [modules] Implement namespace imports. (Closed)
Patch Set: Add comment on VisitModuleNamespaceImports. 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 | « test/mjsunit/modules-namespace3.js ('k') | test/mjsunit/modules-skip-2.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4 //
5 // MODULE
6
7 import * as foo from "modules-namespace4.js";
8
9 assertSame(undefined, a);
10 assertThrows(() => b, ReferenceError);
11 assertThrows(() => c, ReferenceError);
12 assertEquals(45, d());
13
14 assertSame(undefined, foo.a);
15 assertThrows(() => foo.b, ReferenceError);
16 assertThrows(() => foo.c, ReferenceError);
17 assertEquals(45, foo.d());
18 assertThrows(() => foo.default, ReferenceError);
19 assertSame(undefined, foo.doesnotexist);
20
21 export var a = 42;
22 export let b = 43;
23 export const c = 44;
24 export function d() { return 45 };
25 export default 46;
26
27 assertEquals(42, a);
28 assertEquals(43, b);
29 assertEquals(44, c);
30 assertEquals(45, d());
31
32 assertEquals(42, foo.a);
33 assertEquals(43, foo.b);
34 assertEquals(44, foo.c);
35 assertEquals(45, foo.d());
36 assertEquals(46, foo.default);
37 assertSame(undefined, foo.doesnotexist);
OLDNEW
« no previous file with comments | « test/mjsunit/modules-namespace3.js ('k') | test/mjsunit/modules-skip-2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698