Skip to content
Snippets Groups Projects
Commit 98b3cc95 authored by Leo Balter's avatar Leo Balter Committed by Rick Waldron
Browse files

flag resolved import specifiers in test files

parent c93b1075
Branches
No related tags found
No related merge requests found
Showing
with 36 additions and 39 deletions
......@@ -26,12 +26,12 @@ const a = '_FIXTURE.js';
const b = '-other_FIXTURE.js';
async function fn() {
const ns1 = await import(x + a);
const ns1 = await import(x + a); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(y + b);
const ns2 = await import(y + b); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -23,13 +23,13 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import([a]);
const ns1 = await import([a]); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
Array.prototype.toString = () => b;
const ns2 = await import([]);
const ns2 = await import([]); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -22,7 +22,7 @@ features: [dynamic-import]
Function.prototype.toString = () => './module-code_FIXTURE.js';
async function fn() {
const ns = await import(() => {});
const ns = await import(() => {}); // import('./module-code_FIXTURE.js')
assert.sameValue(ns.local1, 'Test262');
assert.sameValue(ns.default, 42);
......
......@@ -23,12 +23,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import(await a);
const ns1 = await import(await a); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(await b);
const ns2 = await import(await b); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -21,7 +21,7 @@ features: [dynamic-import]
const await = './module-code_FIXTURE.js';
const getpromise = () => import(await);
const getpromise = () => import(await); // import('./module-code_FIXTURE.js')
async function fn() {
const ns1 = await getpromise();
......
......@@ -31,12 +31,12 @@ const a = () => () => './module-code_FIXTURE.js';
const b = () => () => './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import(a()());
const ns1 = await import(a()()); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(b()());
const ns2 = await import(b()()); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -30,12 +30,12 @@ features: [dynamic-import]
const a = () => ['./module-code_FIXTURE.js', './module-code-other_FIXTURE.js'];
async function fn() {
const ns1 = await import(a()[0]);
const ns1 = await import(a()[0]); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(a()[0, 1]);
const ns2 = await import(a()[0, 1]); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -33,12 +33,12 @@ const a = () => ({
});
async function fn() {
const ns1 = await import(a().x);
const ns1 = await import(a().x); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(a().y);
const ns2 = await import(a().y); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -31,12 +31,12 @@ const a = () => './module-code_FIXTURE.js';
const b = () => './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import(a());
const ns1 = await import(a()); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(b());
const ns2 = await import(b()); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -23,12 +23,12 @@ features: [dynamic-import]
---*/
async function fn() {
const ns1 = await import((((((('./module-code_FIXTURE.js')))))));
const ns1 = await import((((((('./module-code_FIXTURE.js'))))))); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import((1, 0, './module-code-other_FIXTURE.js'));
const ns2 = await import((1, 0, './module-code-other_FIXTURE.js')); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -23,12 +23,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import(a);
const ns1 = await import(a); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(b);
const ns2 = await import(b); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -26,12 +26,12 @@ const a = '_FIXTURE.js';
const b = '-other_FIXTURE.js';
async function fn() {
const ns1 = await import(x += a);
const ns1 = await import(x += a); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(y += b);
const ns2 = await import(y += b); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -28,12 +28,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import(x = a);
const ns1 = await import(x = a); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(y.z = b);
const ns2 = await import(y.z = b); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -23,13 +23,13 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import(b && a);
const ns1 = await import(b && a); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
// mix it in with Unary Expressions
const ns2 = await import(delete void typeof +-~! 0 && b);
const ns2 = await import(delete void typeof +-~! 0 && b); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -23,12 +23,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import(a || b);
const ns1 = await import(a || b); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(false || b);
const ns2 = await import(false || b); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -26,13 +26,13 @@ const obj = {
async function fn() {
// MemberExpression [ Expression ]
const ns1 = await import(obj['a']);
const ns1 = await import(obj['a']); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
// MemberExpression . IdentifierName
const ns2 = await import(obj.b);
const ns2 = await import(obj.b); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -20,7 +20,7 @@ features: [dynamic-import]
---*/
function ctor() {
return import(new.target);
return import(new.target); // import('./module-code_FIXTURE.js')
}
ctor.toString = () => './module-code_FIXTURE.js';
......
......@@ -23,13 +23,13 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import({ toString() { return a; } });
const ns1 = await import({ toString() { return a; } }); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
Object.prototype.toString = () => b;
const ns2 = await import({});
const ns2 = await import({}); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
......@@ -19,16 +19,13 @@ flags: [async]
features: [dynamic-import]
---*/
const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
function tag(arg) {
return arg[0];
}
async function fn() {
// MemberExpression TemplateLiteral
const ns = await import(tag`./module-code-other_FIXTURE.js`);
const ns = await import(tag`./module-code-other_FIXTURE.js`); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns.local1, 'one six one two');
assert.sameValue(ns.default, 1612);
......
......@@ -23,12 +23,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
async function fn() {
const ns1 = await import(true ? a : b);
const ns1 = await import(true ? a : b); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42);
const ns2 = await import(false ? a : b);
const ns2 = await import(false ? a : b); // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment