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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/modules-namespace4.js
diff --git a/test/mjsunit/modules-namespace4.js b/test/mjsunit/modules-namespace4.js
index 5a20f5e727f79b1d8cda9b8e81fac0859a7fa0de..ef508d5fb858d8b990046f4a66c95e840134b2da 100644
--- a/test/mjsunit/modules-namespace4.js
+++ b/test/mjsunit/modules-namespace4.js
@@ -8,18 +8,30 @@ import * as foo from "modules-namespace4.js";
assertSame(undefined, a);
assertThrows(() => b, ReferenceError);
+assertThrows(() => B, ReferenceError);
assertThrows(() => c, ReferenceError);
assertEquals(45, d());
assertSame(undefined, foo.a);
assertThrows(() => foo.b, ReferenceError);
+assertThrows(() => foo.B, ReferenceError);
assertThrows(() => foo.c, ReferenceError);
assertEquals(45, foo.d());
assertThrows(() => foo.default, ReferenceError);
assertSame(undefined, foo.doesnotexist);
+Function("Foo", " \
+ with (Foo) { \
+ assertEquals(undefined, a); \
+ assertThrows(() => b, ReferenceError); \
+ assertThrows(() => B, ReferenceError); \
+ assertThrows(() => c, ReferenceError); \
+ assertEquals(45, d()); \
+ }")(foo);
+
export var a = 42;
export let b = 43;
+export {b as B};
export const c = 44;
export function d() { return 45 };
export default 46;
@@ -31,7 +43,17 @@ assertEquals(45, d());
assertEquals(42, foo.a);
assertEquals(43, foo.b);
+assertEquals(43, foo.B);
assertEquals(44, foo.c);
assertEquals(45, foo.d());
assertEquals(46, foo.default);
assertSame(undefined, foo.doesnotexist);
+
+Function("Foo", " \
+ with (Foo) { \
+ assertEquals(42, a); \
+ assertEquals(43, b); \
+ assertEquals(43, B); \
+ assertEquals(44, c); \
+ assertEquals(45, d()); \
+ }")(foo);
« 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