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

Unified Diff: test/mjsunit/modules-exports2.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/modules-exports1.js ('k') | test/mjsunit/modules-exports3.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/modules-exports2.js
diff --git a/test/mjsunit/modules-exports2.js b/test/mjsunit/modules-exports2.js
new file mode 100644
index 0000000000000000000000000000000000000000..77f6bb6ccc75d9b598a2c9823f4d25d5108b3019
--- /dev/null
+++ b/test/mjsunit/modules-exports2.js
@@ -0,0 +1,31 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// MODULE
+
+export function foo() { return 42 }
+assertEquals(42, foo());
+foo = 1;
+assertEquals(1, foo);
+
+let gaga = 43;
+export {gaga as gugu};
+assertEquals(43, gaga);
+
+export default (function bar() { return 43 })
+assertThrows(() => bar(), ReferenceError);
+assertThrows("default", SyntaxError);
+assertThrows("*default*", SyntaxError);
+
+
+var bla = 44;
+var blu = 45;
+export {bla};
+export {bla as blu};
+export {bla as bli};
+assertEquals(44, bla);
+assertEquals(45, blu);
+bla = 46;
+assertEquals(46, bla);
+assertEquals(45, blu);
« no previous file with comments | « test/mjsunit/modules-exports1.js ('k') | test/mjsunit/modules-exports3.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698