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

Side by Side Diff: test/mjsunit/modules-exports3.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/modules-exports2.js ('k') | test/mjsunit/modules-this.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 { myvar, mylet, myconst };
8
9 var myvar = "VAR";
10 assertEquals("VAR", myvar);
11 let mylet = "LET";
12 assertEquals("LET", mylet);
13 const myconst = "CONST";
14 assertEquals("CONST", myconst);
15
16 function* gaga() { yield 1 }
17 assertEquals(1, gaga().next().value);
18 export {gaga};
19 export default gaga;
20 export {gaga as gigi};
21 assertEquals(1, gaga().next().value);
22
23
24 export let gugu = 42;
25
26 {
27 assertEquals(42, gugu);
28 }
29
30 try {
31 assertEquals(42, gugu);
32 } catch(_) {
33 assertUnreachable();
34 }
35
36 try {
37 throw {};
38 } catch(_) {
39 assertEquals(42, gugu);
40 }
41
42 try {
43 throw {};
44 } catch({x=gugu}) {
45 assertEquals(42, x);
46 }
47
48 assertEquals(5, eval("var x = 5; x"));
OLDNEW
« no previous file with comments | « test/mjsunit/modules-exports2.js ('k') | test/mjsunit/modules-this.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698