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

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

Issue 2302783002: [modules] Basic support of exports (Closed)
Patch Set: Disable module tests for deopt fuzzer. Created 4 years, 3 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/mjsunit.status ('k') | test/mjsunit/modules-exports2.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 export var myvar = "VAR";
8 assertEquals("VAR", myvar);
9 assertEquals("VAR", eval("myvar"));
10 (() => assertEquals("VAR", myvar))();
11
12 export let mylet = "LET";
13 assertEquals("LET", mylet);
14 assertEquals("LET", eval("mylet"));
15 (() => assertEquals("LET", mylet))();
16
17 export const myconst = "CONST";
18 assertEquals("CONST", myconst);
19 assertEquals("CONST", eval("myconst"));
20 (() => assertEquals("CONST", myconst))();
21
22
23 myvar = 1;
24 assertEquals(1, myvar);
25 assertEquals(1, eval("myvar"));
26 (() => assertEquals(1, myvar))();
27 (() => myvar = 2)();
28 assertEquals(2, myvar);
29 (() => assertEquals(2, myvar))();
30 {
31 let f = () => assertEquals(2, myvar);
32 f();
33 }
34
35 mylet = 1;
36 assertEquals(1, mylet);
37 assertEquals(1, eval("mylet"));
38 (() => assertEquals(1, mylet))();
39 (() => mylet = 2)();
40 assertEquals(2, mylet);
41 assertEquals(2, eval("mylet"));
42 (() => assertEquals(2, mylet))();
43 {
44 let f = () => assertEquals(2, mylet);
45 f();
46 }
47
48 assertThrows(() => myconst = 1, TypeError);
49 assertEquals("CONST", myconst);
50 assertEquals("CONST", eval("myconst"));
51 (() => assertEquals("CONST", myconst))();
52 {
53 let f = () => assertEquals("CONST", myconst);
54 f();
55 }
OLDNEW
« no previous file with comments | « test/mjsunit/mjsunit.status ('k') | test/mjsunit/modules-exports2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698