mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 15:04:43 +02:00
Small fixups on the templates and create a checklist (WIP)
This commit is contained in:
parent
24d1a78015
commit
8b021346a5
@ -6,8 +6,7 @@ desc: It's a SyntaxError if AssignmentExpression is omitted
|
|||||||
template: syntax/invalid
|
template: syntax/invalid
|
||||||
info: |
|
info: |
|
||||||
ImportCall :
|
ImportCall :
|
||||||
import()
|
import( AssignmentExpression[+In, ?Yield] )
|
||||||
|
|
||||||
---*/
|
---*/
|
||||||
//- import
|
//- import
|
||||||
import()
|
import()
|
@ -3,7 +3,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
path: language/module-code/dynamic-import/catch/nested-do-while-
|
path: language/module-code/dynamic-import/catch/nested-do-while-
|
||||||
name: nested do syntax
|
name: nested do while syntax
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
info: |
|
info: |
|
||||||
ImportCall :
|
ImportCall :
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
|
||||||
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
path: language/module-code/dynamic-import/catch/nested-do-import-catch-
|
|
||||||
name: nested do
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
info: |
|
|
||||||
ImportCall :
|
|
||||||
import( AssignmentExpression )
|
|
||||||
|
|
||||||
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
|
||||||
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
|
||||||
3. Let argRef be the result of evaluating AssignmentExpression.
|
|
||||||
4. Let specifier be ? GetValue(argRef).
|
|
||||||
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
|
||||||
6. Let specifierString be ToString(specifier).
|
|
||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
|
||||||
9. Return promiseCapability.[[Promise]].
|
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
|
||||||
flags: [async]
|
|
||||||
---*/
|
|
||||||
|
|
||||||
let x = 0;
|
|
||||||
do {
|
|
||||||
x++;
|
|
||||||
import(/*{ params }*/).catch(error => {
|
|
||||||
|
|
||||||
/*{ body }*/
|
|
||||||
|
|
||||||
}).then($DONE, $DONE);
|
|
||||||
} while (!x);
|
|
@ -1,33 +0,0 @@
|
|||||||
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
|
||||||
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
path: language/module-code/dynamic-import/catch/nested-labeled-block-import-catch-
|
|
||||||
name: nested labeled block
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
info: |
|
|
||||||
ImportCall :
|
|
||||||
import( AssignmentExpression )
|
|
||||||
|
|
||||||
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
|
||||||
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
|
||||||
3. Let argRef be the result of evaluating AssignmentExpression.
|
|
||||||
4. Let specifier be ? GetValue(argRef).
|
|
||||||
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
|
||||||
6. Let specifierString be ToString(specifier).
|
|
||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
|
||||||
9. Return promiseCapability.[[Promise]].
|
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
|
||||||
flags: [async]
|
|
||||||
---*/
|
|
||||||
|
|
||||||
{
|
|
||||||
import(/*{ params }*/).catch(error => {
|
|
||||||
|
|
||||||
/*{ body }*/
|
|
||||||
|
|
||||||
}).then($DONE, $DONE);
|
|
||||||
};
|
|
28
src/dynamic-import/checklist.md
Normal file
28
src/dynamic-import/checklist.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Coverage Checklist for `import()`
|
||||||
|
|
||||||
|
## Default Templates
|
||||||
|
|
||||||
|
_general places it can be found as a CallExpression_
|
||||||
|
|
||||||
|
- [x] consise body of an ArrowFunction
|
||||||
|
- [x] function body of an ArrowFunction
|
||||||
|
- [ ] consise body of an __Async__ ArrowFunction
|
||||||
|
- [ ] function body of an __Async__ ArrowFunction
|
||||||
|
- [ ] async function await
|
||||||
|
|
||||||
|
## Cases
|
||||||
|
|
||||||
|
### Syntax
|
||||||
|
|
||||||
|
- [x] assignment expression is not optional
|
||||||
|
- [x] empty string is a valid assignment expression (not a syntax error)
|
||||||
|
|
||||||
|
##
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -29,7 +29,7 @@ async function f() {
|
|||||||
|
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
|
|
||||||
}).then($DONE, $DONE).catch($DONE);
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
f();
|
f().then($DONE, $DONE).catch($DONE);
|
||||||
|
@ -25,11 +25,11 @@ flags: [async]
|
|||||||
---*/
|
---*/
|
||||||
|
|
||||||
async function f() {
|
async function f() {
|
||||||
return await import(/*{ params }*/).then(imported => {
|
return await import(/*{ params }*/);
|
||||||
|
|
||||||
/*{ body }*/
|
|
||||||
|
|
||||||
}).then($DONE, $DONE).catch($DONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f();
|
f().then(imported => {
|
||||||
|
|
||||||
|
/*{ body }*/
|
||||||
|
|
||||||
|
}).then($DONE, $DONE).catch($DONE);
|
||||||
|
@ -33,4 +33,3 @@ async function f() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
f();
|
f();
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
path: language/module-code/dynamic-import/nested-do-while-
|
path: language/module-code/dynamic-import/nested-do-while-
|
||||||
name: nested do syntax
|
name: nested do while syntax
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
info: |
|
info: |
|
||||||
ImportCall :
|
ImportCall :
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
|
||||||
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
path: language/module-code/dynamic-import/nested-do-import-then-
|
|
||||||
name: nested do
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
info: |
|
|
||||||
ImportCall :
|
|
||||||
import( AssignmentExpression )
|
|
||||||
|
|
||||||
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
|
||||||
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
|
||||||
3. Let argRef be the result of evaluating AssignmentExpression.
|
|
||||||
4. Let specifier be ? GetValue(argRef).
|
|
||||||
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
|
||||||
6. Let specifierString be ToString(specifier).
|
|
||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
|
||||||
9. Return promiseCapability.[[Promise]].
|
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
|
||||||
flags: [async]
|
|
||||||
---*/
|
|
||||||
|
|
||||||
let x = 0;
|
|
||||||
do {
|
|
||||||
x++;
|
|
||||||
import(/*{ params }*/).then(imported => {
|
|
||||||
|
|
||||||
/*{ body }*/
|
|
||||||
|
|
||||||
}).then($DONE, $DONE).catch($DONE);
|
|
||||||
} while (!x);
|
|
@ -1,33 +0,0 @@
|
|||||||
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
|
||||||
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
path: language/module-code/dynamic-import/nested-labeled-block-import-then-
|
|
||||||
name: nested block
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
info: |
|
|
||||||
ImportCall :
|
|
||||||
import( AssignmentExpression )
|
|
||||||
|
|
||||||
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
|
||||||
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
|
||||||
3. Let argRef be the result of evaluating AssignmentExpression.
|
|
||||||
4. Let specifier be ? GetValue(argRef).
|
|
||||||
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
|
||||||
6. Let specifierString be ToString(specifier).
|
|
||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
|
||||||
9. Return promiseCapability.[[Promise]].
|
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
|
||||||
flags: [async]
|
|
||||||
---*/
|
|
||||||
|
|
||||||
{
|
|
||||||
import(/*{ params }*/).then(imported => {
|
|
||||||
|
|
||||||
/*{ body }*/
|
|
||||||
|
|
||||||
}).then($DONE, $DONE).catch($DONE);
|
|
||||||
};
|
|
@ -3,7 +3,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
path: language/module-code/dynamic-import/syntax/invalid/nested-do-while-
|
path: language/module-code/dynamic-import/syntax/invalid/nested-do-while-
|
||||||
name: nested do syntax
|
name: nested do while syntax
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
info: |
|
info: |
|
||||||
ImportCall :
|
ImportCall :
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
|
||||||
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
path: language/module-code/dynamic-import/syntax/invalid/nested-do-
|
|
||||||
name: nested do syntax
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
info: |
|
|
||||||
ImportCall :
|
|
||||||
import( AssignmentExpression )
|
|
||||||
|
|
||||||
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
|
||||||
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
|
||||||
3. Let argRef be the result of evaluating AssignmentExpression.
|
|
||||||
4. Let specifier be ? GetValue(argRef).
|
|
||||||
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
|
||||||
6. Let specifierString be ToString(specifier).
|
|
||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
|
||||||
9. Return promiseCapability.[[Promise]].
|
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
|
||||||
negative:
|
|
||||||
phase: parse
|
|
||||||
type: SyntaxError
|
|
||||||
---*/
|
|
||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
|
||||||
|
|
||||||
let x = 0;
|
|
||||||
do {
|
|
||||||
x++;
|
|
||||||
/*{ import }*/;
|
|
||||||
} while (!x);
|
|
@ -1,33 +0,0 @@
|
|||||||
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
|
||||||
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
path: language/module-code/dynamic-import/syntax/invalid/nested-labeled-block-
|
|
||||||
name: nested block syntax
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
info: |
|
|
||||||
ImportCall :
|
|
||||||
import( AssignmentExpression )
|
|
||||||
|
|
||||||
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
|
||||||
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
|
||||||
3. Let argRef be the result of evaluating AssignmentExpression.
|
|
||||||
4. Let specifier be ? GetValue(argRef).
|
|
||||||
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
|
||||||
6. Let specifierString be ToString(specifier).
|
|
||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
|
||||||
9. Return promiseCapability.[[Promise]].
|
|
||||||
|
|
||||||
flags: [module]
|
|
||||||
features: [dynamic-import]
|
|
||||||
negative:
|
|
||||||
phase: parse
|
|
||||||
type: SyntaxError
|
|
||||||
---*/
|
|
||||||
|
|
||||||
throw "Test262: This statement should not be evaluated.";
|
|
||||||
|
|
||||||
{
|
|
||||||
/*{ import }*/;
|
|
||||||
};
|
|
@ -3,7 +3,7 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
path: language/module-code/dynamic-import/syntax/valid/nested-do-while-
|
path: language/module-code/dynamic-import/syntax/valid/nested-do-while-
|
||||||
name: nested do syntax
|
name: nested do while syntax
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
esid: sec-import-call-runtime-semantics-evaluation
|
||||||
info: |
|
info: |
|
||||||
ImportCall :
|
ImportCall :
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
|
||||||
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
path: language/module-code/dynamic-import/syntax/valid/nested-do-
|
|
||||||
name: nested do syntax
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
info: |
|
|
||||||
ImportCall :
|
|
||||||
import( AssignmentExpression )
|
|
||||||
|
|
||||||
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
|
||||||
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
|
||||||
3. Let argRef be the result of evaluating AssignmentExpression.
|
|
||||||
4. Let specifier be ? GetValue(argRef).
|
|
||||||
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
|
||||||
6. Let specifierString be ToString(specifier).
|
|
||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
|
||||||
9. Return promiseCapability.[[Promise]].
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
|
||||||
---*/
|
|
||||||
|
|
||||||
let x = 0;
|
|
||||||
do {
|
|
||||||
x++;
|
|
||||||
/*{ import }*/;
|
|
||||||
} while (!x);
|
|
@ -1,28 +0,0 @@
|
|||||||
// Copyright (C) 2018 Rick Waldron. All rights reserved.
|
|
||||||
// Copyright (C) 2018 the V8 project authors. All rights reserved.
|
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
|
||||||
/*---
|
|
||||||
path: language/module-code/dynamic-import/syntax/valid/nested-labeled-block-
|
|
||||||
name: nested block syntax
|
|
||||||
esid: sec-import-call-runtime-semantics-evaluation
|
|
||||||
info: |
|
|
||||||
ImportCall :
|
|
||||||
import( AssignmentExpression )
|
|
||||||
|
|
||||||
1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
|
|
||||||
2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
|
|
||||||
3. Let argRef be the result of evaluating AssignmentExpression.
|
|
||||||
4. Let specifier be ? GetValue(argRef).
|
|
||||||
5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
|
|
||||||
6. Let specifierString be ToString(specifier).
|
|
||||||
7. IfAbruptRejectPromise(specifierString, promiseCapability).
|
|
||||||
8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
|
|
||||||
9. Return promiseCapability.[[Promise]].
|
|
||||||
|
|
||||||
|
|
||||||
features: [dynamic-import]
|
|
||||||
---*/
|
|
||||||
|
|
||||||
{
|
|
||||||
/*{ import }*/;
|
|
||||||
};
|
|
Loading…
x
Reference in New Issue
Block a user