flag resolved import specifiers in test files

This commit is contained in:
Leo Balter 2018-10-19 12:22:19 -04:00 committed by Rick Waldron
parent c93b1075f5
commit 98b3cc95f7
24 changed files with 42 additions and 45 deletions

View File

@ -26,12 +26,12 @@ const a = '_FIXTURE.js';
const b = '-other_FIXTURE.js'; const b = '-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -23,13 +23,13 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js'; const b = './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); assert.sameValue(ns1.default, 42);
Array.prototype.toString = () => b; 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -22,7 +22,7 @@ features: [dynamic-import]
Function.prototype.toString = () => './module-code_FIXTURE.js'; Function.prototype.toString = () => './module-code_FIXTURE.js';
async function fn() { async function fn() {
const ns = await import(() => {}); const ns = await import(() => {}); // import('./module-code_FIXTURE.js')
assert.sameValue(ns.local1, 'Test262'); assert.sameValue(ns.local1, 'Test262');
assert.sameValue(ns.default, 42); assert.sameValue(ns.default, 42);

View File

@ -23,12 +23,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js'; const b = './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -21,7 +21,7 @@ features: [dynamic-import]
const await = './module-code_FIXTURE.js'; const await = './module-code_FIXTURE.js';
const getpromise = () => import(await); const getpromise = () => import(await); // import('./module-code_FIXTURE.js')
async function fn() { async function fn() {
const ns1 = await getpromise(); const ns1 = await getpromise();

View File

@ -31,12 +31,12 @@ const a = () => () => './module-code_FIXTURE.js';
const b = () => () => './module-code-other_FIXTURE.js'; const b = () => () => './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -30,12 +30,12 @@ features: [dynamic-import]
const a = () => ['./module-code_FIXTURE.js', './module-code-other_FIXTURE.js']; const a = () => ['./module-code_FIXTURE.js', './module-code-other_FIXTURE.js'];
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -33,12 +33,12 @@ const a = () => ({
}); });
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -31,12 +31,12 @@ const a = () => './module-code_FIXTURE.js';
const b = () => './module-code-other_FIXTURE.js'; const b = () => './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -23,12 +23,12 @@ features: [dynamic-import]
---*/ ---*/
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -23,12 +23,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js'; const b = './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -26,12 +26,12 @@ const a = '_FIXTURE.js';
const b = '-other_FIXTURE.js'; const b = '-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -28,12 +28,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js'; const b = './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -23,13 +23,13 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js'; const b = './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); assert.sameValue(ns1.default, 42);
// mix it in with Unary Expressions // 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -23,12 +23,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js'; const b = './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -26,13 +26,13 @@ const obj = {
async function fn() { async function fn() {
// MemberExpression [ Expression ] // 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); assert.sameValue(ns1.default, 42);
// MemberExpression . IdentifierName // 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -20,7 +20,7 @@ features: [dynamic-import]
---*/ ---*/
function ctor() { function ctor() {
return import(new.target); return import(new.target); // import('./module-code_FIXTURE.js')
} }
ctor.toString = () => './module-code_FIXTURE.js'; ctor.toString = () => './module-code_FIXTURE.js';

View File

@ -23,13 +23,13 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js'; const b = './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); assert.sameValue(ns1.default, 42);
Object.prototype.toString = () => b; 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -19,16 +19,13 @@ flags: [async]
features: [dynamic-import] features: [dynamic-import]
---*/ ---*/
const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js';
function tag(arg) { function tag(arg) {
return arg[0]; return arg[0];
} }
async function fn() { async function fn() {
// MemberExpression TemplateLiteral // 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.local1, 'one six one two');
assert.sameValue(ns.default, 1612); assert.sameValue(ns.default, 1612);

View File

@ -23,12 +23,12 @@ const a = './module-code_FIXTURE.js';
const b = './module-code-other_FIXTURE.js'; const b = './module-code-other_FIXTURE.js';
async function fn() { 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.local1, 'Test262');
assert.sameValue(ns1.default, 42); 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.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -23,7 +23,7 @@ features: [dynamic-import]
---*/ ---*/
async function fn() { async function fn() {
const ns1 = await import(this); const ns1 = await import(this); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262'); assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42); assert.sameValue(ns1.default, 42);

View File

@ -30,7 +30,7 @@ async function *fn() {
let iter = g(); let iter = g();
assert.sameValue(iter.next().value, 42); assert.sameValue(iter.next().value, 42);
const ns1 = await iter.next(a).value; const ns1 = await iter.next(a).value; // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262'); assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42); assert.sameValue(ns1.default, 42);
@ -38,7 +38,7 @@ async function *fn() {
iter = g(); iter = g();
assert.sameValue(iter.next().value, 42); assert.sameValue(iter.next().value, 42);
const ns2 = await iter.next(b).value; const ns2 = await iter.next(b).value; // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two'); assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -30,7 +30,7 @@ async function *fn() {
let iter = g(); let iter = g();
iter.next(); iter.next();
const ns1 = await iter.next(a).value; const ns1 = await iter.next(a).value; // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262'); assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42); assert.sameValue(ns1.default, 42);
@ -38,7 +38,7 @@ async function *fn() {
iter = g(); iter = g();
iter.next(); iter.next();
const ns2 = await iter.next(b).value; const ns2 = await iter.next(b).value; // import('./module-code-other_FIXTURE.js')
assert.sameValue(ns2.local1, 'one six one two'); assert.sameValue(ns2.local1, 'one six one two');
assert.sameValue(ns2.default, 1612); assert.sameValue(ns2.default, 1612);

View File

@ -22,7 +22,7 @@ features: [dynamic-import]
const yield = './module-code_FIXTURE.js'; const yield = './module-code_FIXTURE.js';
async function fn() { async function fn() {
const ns1 = await import(yield); const ns1 = await import(yield); // import('./module-code_FIXTURE.js')
assert.sameValue(ns1.local1, 'Test262'); assert.sameValue(ns1.local1, 'Test262');
assert.sameValue(ns1.default, 42); assert.sameValue(ns1.default, 42);