diff --git a/src/dynamic-import/import-assertions-trailing-comma-first.case b/src/dynamic-import/import-assertions-trailing-comma-first.case deleted file mode 100644 index dc33458cc8..0000000000 --- a/src/dynamic-import/import-assertions-trailing-comma-first.case +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2018 Leo Balter. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -desc: ImportCall trailing comma following first parameter -template: syntax/valid -info: | - ImportCall : - import( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [import-assertions] ----*/ - -//- import -import('./empty_FIXTURE.js',) diff --git a/src/dynamic-import/import-assertions-trailing-comma-second.case b/src/dynamic-import/import-assertions-trailing-comma-second.case deleted file mode 100644 index f82af0a93a..0000000000 --- a/src/dynamic-import/import-assertions-trailing-comma-second.case +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2021 V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -desc: ImportCall trailing comma following second parameter -template: syntax/valid -info: | - ImportCall : - import( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [import-assertions] ----*/ - -//- import -import('./empty_FIXTURE.js', {},) diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-enumeration-abrupt.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-enumeration-abrupt.js deleted file mode 100644 index 282c7613aa..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-enumeration-abrupt.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Reports abrupt completions produced by attributes enumeration -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - [...] - 6. Let promiseCapability be ! NewPromiseCapability(%Promise%). - 7. Let specifierString be ToString(specifier). - 8. IfAbruptRejectPromise(specifierString, promiseCapability). - 9. Let assertions be a new empty List. - 10. If options is not undefined, then - a. If Type(options) is not Object, - [...] - b. Let assertionsObj be Get(options, "assert"). - c. IfAbruptRejectPromise(assertionsObj, promiseCapability). - d. If assertionsObj is not undefined, - i. If Type(assertionsObj) is not Object, - [...] - ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key). - iii. IfAbruptRejectPromise(keys, promiseCapability). - [...] -features: [dynamic-import, import-assertions, Proxy] -flags: [async] ----*/ - -var thrown = new Test262Error(); -var options = { - assert: new Proxy({}, { - ownKeys: function() { - throw thrown; - }, - }) -}; - -import('./2nd-param_FIXTURE.js', options) - .then(function() { - throw new Test262Error('Expected promise to be rejected, but promise was fulfilled.'); - }, function(error) { - assert.sameValue(error, thrown); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-enumeration-enumerable.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-enumeration-enumerable.js deleted file mode 100644 index 151bb1738d..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-enumeration-enumerable.js +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Follows the semantics of the EnumerableOwnPropertyNames abstract operation - during attributes enumeration -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - [...] - 6. Let promiseCapability be ! NewPromiseCapability(%Promise%). - 7. Let specifierString be ToString(specifier). - 8. IfAbruptRejectPromise(specifierString, promiseCapability). - 9. Let assertions be a new empty List. - 10. If options is not undefined, then - a. If Type(options) is not Object, - [...] - b. Let assertionsObj be Get(options, "assert"). - c. IfAbruptRejectPromise(assertionsObj, promiseCapability). - d. If assertionsObj is not undefined, - i. If Type(assertionsObj) is not Object, - [...] - ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key). - [...] -features: [dynamic-import, import-assertions, json-modules, Symbol, Proxy] -includes: [compareArray.js] -flags: [async] ----*/ - -var symbol = Symbol(''); -var target = { - type: "json" -}; -var descriptors = { - type: {configurable: true, enumerable: true} -}; -var log = []; - -var options = { - assert: new Proxy({}, { - ownKeys: function() { - return ["type"]; - }, - get(_, name) { - log.push(name); - return "json"; - }, - getOwnPropertyDescriptor(target, name) { - return {configurable: true, enumerable: true, value: "json"}; - }, - }) -}; - -import('./2nd-param_FIXTURE.json', options) - .then(function(module) { - assert.sameValue(module.default, 262); - }) - .then($DONE, $DONE); - -assert.compareArray(log, ['type']); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-enumeration.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-enumeration.js deleted file mode 100644 index cfa9d28a8f..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-enumeration.js +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Follows the semantics of the EnumerableOwnPropertyNames abstract operation - during attributes enumeration -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - [...] - 6. Let promiseCapability be ! NewPromiseCapability(%Promise%). - 7. Let specifierString be ToString(specifier). - 8. IfAbruptRejectPromise(specifierString, promiseCapability). - 9. Let assertions be a new empty List. - 10. If options is not undefined, then - a. If Type(options) is not Object, - [...] - b. Let assertionsObj be Get(options, "assert"). - c. IfAbruptRejectPromise(assertionsObj, promiseCapability). - d. If assertionsObj is not undefined, - i. If Type(assertionsObj) is not Object, - [...] - ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key). - [...] -features: [dynamic-import, import-assertions, Symbol, Proxy] -flags: [async] ----*/ - -var symbol = Symbol(''); -var target = { - [symbol]: '', - unreported: '', - nonEnumerable: '' -}; -var descriptors = { - [symbol]: {configurable: true, enumerable: true}, - nonEnumerable: {configurable: true, enumerable: false} -}; - -var options = { - assert: new Proxy({}, { - ownKeys: function() { - return [symbol, 'nonEnumerable', 'absent']; - }, - get() { - throw new Error("Should not be called"); - }, - getOwnPropertyDescriptor(target, name) { - return descriptors[name]; - } - }) -}; - -import('./2nd-param_FIXTURE.js', options) - .then(function(module) { - assert.sameValue(module.default, 262); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-non-object.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-non-object.js deleted file mode 100644 index d685ee83d3..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-non-object.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Rejects promise when the `assert` property of the second argument is neither - undefined nor an object -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - [...] - 6. Let promiseCapability be ! NewPromiseCapability(%Promise%). - 7. Let specifierString be ToString(specifier). - 8. IfAbruptRejectPromise(specifierString, promiseCapability). - 9. Let assertions be a new empty List. - 10. If options is not undefined, then - a. If Type(options) is not Object, - [...] - b. Let assertionsObj be Get(options, "assert"). - c. IfAbruptRejectPromise(assertionsObj, promiseCapability). - d. If assertionsObj is not undefined, - i. If Type(assertionsObj) is not Object, - 1. Perform ! Call(promiseCapability.[[Reject]], undefined, « a - newly created TypeError object »). - 2. Return promiseCapability.[[Promise]]. - [...] -features: [dynamic-import, import-assertions, Symbol, BigInt] -flags: [async] ----*/ - -function test(promise, valueType) { - return promise.then(function() { - throw new Test262Error('Promise for ' + valueType + ' was not rejected.'); - }, function(error) { - assert.sameValue(error.constructor, TypeError, valueType); - }); -} - -Promise.all([ - test(import('./2nd-param_FIXTURE.js', {assert:null}), 'null'), - test(import('./2nd-param_FIXTURE.js', {assert:false}), 'boolean'), - test(import('./2nd-param_FIXTURE.js', {assert:23}), 'number'), - test(import('./2nd-param_FIXTURE.js', {assert:''}), 'string'), - test(import('./2nd-param_FIXTURE.js', {assert:Symbol('')}), 'symbol'), - test(import('./2nd-param_FIXTURE.js', {assert:23n}), 'bigint') - ]) - .then(function() {}) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-undefined.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-undefined.js deleted file mode 100644 index bdd4003d38..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-undefined.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Accepts undefined for the `assert` property of the second argument -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - [...] - 6. Let promiseCapability be ! NewPromiseCapability(%Promise%). - 7. Let specifierString be ToString(specifier). - 8. IfAbruptRejectPromise(specifierString, promiseCapability). - 9. Let assertions be a new empty List. - 10. If options is not undefined, then - a. If Type(options) is not Object, - [...] - b. Let assertionsObj be Get(options, "assert"). - c. IfAbruptRejectPromise(assertionsObj, promiseCapability). - d. If assertionsObj is not undefined, - i. If Type(assertionsObj) is not Object, - 1. Perform ! Call(promiseCapability.[[Reject]], undefined, « a - newly created TypeError object »). - 2. Return promiseCapability.[[Promise]]. - [...] -features: [dynamic-import, import-assertions, Symbol, BigInt] -flags: [async] ----*/ - -Promise.all([ - import('./2nd-param_FIXTURE.js', {}), - import('./2nd-param_FIXTURE.js', {assert:undefined}), - ]) - .then(function(values) { - assert.sameValue(values[0].default, 262); - assert.sameValue(values[1].default, 262); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-value-abrupt.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-value-abrupt.js deleted file mode 100644 index e840a71950..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-value-abrupt.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Rejects promise when retrieving a value of the `assert` object produces an - abrupt completion -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - [...] - 10. If options is not undefined, then - [...] - d. If assertionsObj is not undefined, - [...] - ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key). - iii. IfAbruptRejectPromise(keys, promiseCapability). - iv. Let supportedAssertions be ! HostGetSupportedImportAssertions(). - v. For each String key of keys, - 1. Let value be Get(assertionsObj, key). - 2. IfAbruptRejectPromise(value, promiseCapability). - [...] -features: [dynamic-import, import-assertions] -flags: [async] ----*/ - -var thrown = new Test262Error(); - -import('./2nd-param_FIXTURE.js', {assert:{get ''() { throw thrown; }}}) - .then(function() { - throw new Test262Error('Expected promise to be rejected, but it was fulfilled'); - }, function(error) { - assert.sameValue(error, thrown); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-value-non-string.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-value-non-string.js deleted file mode 100644 index aa71b1c282..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-assert-value-non-string.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Rejects promise when any property of the `assert` object is not a string -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - [...] - 10. If options is not undefined, then - [...] - d. If assertionsObj is not undefined, - [...] - ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key). - iii. IfAbruptRejectPromise(keys, promiseCapability). - iv. Let supportedAssertions be ! HostGetSupportedImportAssertions(). - v. For each String key of keys, - 1. Let value be Get(assertionsObj, key). - 2. IfAbruptRejectPromise(value, promiseCapability). - 3. If Type(value) is not String, then - a. Perform ! Call(promiseCapability.[[Reject]], undefined, « a - newly created TypeError object »). - b. Return promiseCapability.[[Promise]]. - [...] -features: [dynamic-import, import-assertions, Symbol, BigInt] -flags: [async] ----*/ - -function test(promise, valueType) { - return promise.then(function() { - throw new Test262Error('Promise for ' + valueType + ' was not rejected.'); - }, function(error) { - assert.sameValue(error.constructor, TypeError, valueType); - }); -} - -Promise.all([ - test(import('./2nd-param_FIXTURE.js', {assert:{'': undefined}}), 'undefined'), - test(import('./2nd-param_FIXTURE.js', {assert:{'': null}}), 'null'), - test(import('./2nd-param_FIXTURE.js', {assert:{'': false}}), 'boolean'), - test(import('./2nd-param_FIXTURE.js', {assert:{'': 23}}), 'number'), - test(import('./2nd-param_FIXTURE.js', {assert:{'': Symbol('')}}), 'symbol'), - test(import('./2nd-param_FIXTURE.js', {assert:{'': 23n}}), 'bigint'), - test(import('./2nd-param_FIXTURE.js', {assert:{'': {}}}), 'object') - ]) - .then(function() {}) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-await-expr.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-await-expr.js deleted file mode 100644 index 966ab94369..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-await-expr.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - ImportCall parameter list forwards the Await production parameter - AwaitExpression -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions, async-functions] -flags: [async] ----*/ - -(async function () { - return import('./2nd-param_FIXTURE.js', await undefined); -}()) - .then(function(module) { - assert.sameValue(module.default, 262); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-await-ident.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-await-ident.js deleted file mode 100644 index d13ca53b20..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-await-ident.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - ImportCall parameter list forwards the Await production parameter - IdentifierReference -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions, async-functions] -flags: [async] ----*/ - -function await() {} - -import('./2nd-param_FIXTURE.js', await(undefined)) - .then(function(module) { - assert.sameValue(module.default, 262); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-evaluation-abrupt-return.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-evaluation-abrupt-return.js deleted file mode 100644 index 6da4a5482b..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-evaluation-abrupt-return.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Forwards "return" completion when evaluating second parameter -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). - 2. Let specifierRef be the result of evaluating specifierExpression. - 3. Let specifier be ? GetValue(specifierRef). - 4. If optionsExpression is present, then - a. Let optionsRef be the result of evaluating optionsExpression. - b. Let options be ? GetValue(optionsRef). - [...] -features: [dynamic-import, import-assertions] ----*/ - -var beforeCount = 0; -var afterCount = 0; -var iter = function*() { - beforeCount += 1, import('', yield), afterCount += 1; -}(); - -iter.next(); -var result = iter.return(595); - -assert.sameValue(result.done, true); -assert.sameValue(result.value, 595); -assert.sameValue(beforeCount, 1); -assert.sameValue(afterCount, 0); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-evaluation-abrupt-throw.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-evaluation-abrupt-throw.js deleted file mode 100644 index e5e6619096..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-evaluation-abrupt-throw.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Forwards "throw" completion when evaluating second parameter -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). - 2. Let specifierRef be the result of evaluating specifierExpression. - 3. Let specifier be ? GetValue(specifierRef). - 4. If optionsExpression is present, then - a. Let optionsRef be the result of evaluating optionsExpression. - b. Let options be ? GetValue(optionsRef). - [...] -features: [dynamic-import, import-assertions] ----*/ - -var beforeCount = 0; -var afterCount = 0; -function throwError() { - throw new Test262Error(); -} - -assert.throws(Test262Error, function() { - beforeCount += 1, import('', throwError()), afterCount += 1; -}); - -assert.sameValue(beforeCount, 1); -assert.sameValue(afterCount, 0); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-evaluation-sequence.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-evaluation-sequence.js deleted file mode 100644 index 9795c4bada..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-evaluation-sequence.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Evaluates parameters in correct sequence -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). - 2. Let specifierRef be the result of evaluating specifierExpression. - 3. Let specifier be ? GetValue(specifierRef). - 4. If optionsExpression is present, then - a. Let optionsRef be the result of evaluating optionsExpression. - b. Let options be ? GetValue(optionsRef). - [...] -features: [dynamic-import, import-assertions] ----*/ - -var log = []; - -import(log.push('first'), (log.push('second'), undefined)) - .then(null, function() {}); - -assert.sameValue(log.length, 2); -assert.sameValue(log[0], 'first'); -assert.sameValue(log[1], 'second'); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-get-assert-error.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-get-assert-error.js deleted file mode 100644 index d7bb7d8c04..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-get-assert-error.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Rejects promise when accessing "assert" property throws an error -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - [...] - 6. Let promiseCapability be ! NewPromiseCapability(%Promise%). - 7. Let specifierString be ToString(specifier). - 8. IfAbruptRejectPromise(specifierString, promiseCapability). - 9. Let assertions be a new empty List. - 10. If options is not undefined, then - a. If Type(options) is not Object, - [...] - b. Let assertionsObj be Get(options, "assert"). - c. IfAbruptRejectPromise(assertionsObj, promiseCapability). - [...] -features: [dynamic-import, import-assertions] -flags: [async] ----*/ - -var thrown = new Test262Error(); -var options = { - get assert() { - throw thrown; - } -}; - -import('./2nd-param_FIXTURE.js', options) - .then(function() { - throw new Test262Error('Expected an error, but observed no error'); - }, function(caught) { - assert.sameValue(thrown, caught); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-in.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-in.js deleted file mode 100644 index 6d8ac2b0eb..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-in.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: ImportCall parameter list enables the Yield production parameter -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions] -flags: [async] ----*/ - -var promise; - -for (promise = import('./2nd-param_FIXTURE.js', 'test262' in {} || undefined); false; ) ; - -promise - .then(function(module) { - assert.sameValue(module.default, 262); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-non-object.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-non-object.js deleted file mode 100644 index 28b6e573d1..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-non-object.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Rejects promise when the second argument is neither undefined nor an object -esid: sec-import-call-runtime-semantics-evaluation -info: | - 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] ) - [...] - 6. Let promiseCapability be ! NewPromiseCapability(%Promise%). - 7. Let specifierString be ToString(specifier). - 8. IfAbruptRejectPromise(specifierString, promiseCapability). - 9. Let assertions be a new empty List. - 10. If options is not undefined, then - a. If Type(options) is not Object, - i. Perform ! Call(promiseCapability.[[Reject]], undefined, « a newly created TypeError object »). - ii. Return promiseCapability.[[Promise]]. - [...] -features: [dynamic-import, import-assertions, Symbol, BigInt] -flags: [async] ----*/ - -function test(promise, valueType) { - return promise.then(function() { - throw new Test262Error('Promise for ' + valueType + ' was not rejected.'); - }, function(error) { - assert.sameValue(error.constructor, TypeError, valueType); - }); -} - -Promise.all([ - test(import('./2nd-param_FIXTURE.js', null), 'null'), - test(import('./2nd-param_FIXTURE.js', false), 'boolean'), - test(import('./2nd-param_FIXTURE.js', 23), 'number'), - test(import('./2nd-param_FIXTURE.js', ''), 'string'), - test(import('./2nd-param_FIXTURE.js', Symbol('')), 'symbol'), - test(import('./2nd-param_FIXTURE.js', 23n), 'bigint') - ]) - .then(function() {}) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-trailing-comma-fulfill.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-trailing-comma-fulfill.js deleted file mode 100644 index c806f3e683..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-trailing-comma-fulfill.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - ImportCall parameter list supports an optional trailing comma (fulfillment - semantics) -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions] -flags: [async] ----*/ - -import('./2nd-param_FIXTURE.js', {},) - .then(function(module) { - assert.sameValue(module.default, 262); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-trailing-comma-reject.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-trailing-comma-reject.js deleted file mode 100644 index 3970c745b6..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-trailing-comma-reject.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - ImportCall parameter list supports an optional trailing comma (rejection - semantics) -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions] -flags: [async] ----*/ - -var thrown = new Test262Error(); - -import({toString: function() { throw thrown; } }, {},) - .then(function() { - throw new Test262Error('Expected promise to be rejected, but it was fulfilled.'); - }, function(caught) { - assert.sameValue(thrown, caught); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-yield-expr.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-yield-expr.js deleted file mode 100644 index b1482ac9e8..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-yield-expr.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - ImportCall parameter list forwards the Yield production parameter - YieldExpression -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions] -flags: [async] ----*/ - -var promise; - -var iter = (function * () { - promise = import('./2nd-param_FIXTURE.js', yield); -}()); - -iter.next(); - -assert.sameValue(promise, undefined); - -iter.next(); - -promise - .then(function(module) { - assert.sameValue(module.default, 262); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-yield-ident-invalid.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-yield-ident-invalid.js deleted file mode 100644 index 56971e8031..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-yield-ident-invalid.js +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - ImportCall parameter list forwards the Yield production parameter - invalid IdentifierReference -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions] -flags: [onlyStrict] -negative: - phase: parse - type: SyntaxError ----*/ -$DONOTEVALUATE(); - -import('./empty_FIXTURE.js', yield); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param-yield-ident-valid.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param-yield-ident-valid.js deleted file mode 100644 index 39a8fe7d6e..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param-yield-ident-valid.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - ImportCall parameter list forwards the Yield production parameter - valid IdentifierReference -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions] -flags: [async, noStrict] ----*/ - -var yield; - -import('./2nd-param_FIXTURE.js', yield) - .then(function(module) { - assert.sameValue(module.default, 262); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param_FIXTURE.js b/test/language/expressions/dynamic-import/import-assertions/2nd-param_FIXTURE.js deleted file mode 100644 index fc9f2fa021..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param_FIXTURE.js +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -export default 262; diff --git a/test/language/expressions/dynamic-import/import-assertions/2nd-param_FIXTURE.json b/test/language/expressions/dynamic-import/import-assertions/2nd-param_FIXTURE.json deleted file mode 100644 index 5484d82917..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/2nd-param_FIXTURE.json +++ /dev/null @@ -1 +0,0 @@ -262 diff --git a/test/language/expressions/dynamic-import/import-assertions/README.md b/test/language/expressions/dynamic-import/import-assertions/README.md deleted file mode 100644 index d80cf27f8e..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Make sure to keep the tests in this folder aligned -with the tests in the import-attributes folder. diff --git a/test/language/expressions/dynamic-import/import-assertions/trailing-comma-fulfill.js b/test/language/expressions/dynamic-import/import-assertions/trailing-comma-fulfill.js deleted file mode 100644 index 0d3689b37e..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/trailing-comma-fulfill.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - ImportCall parameter list supports an optional trailing comma (fulfillment - semantics) -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions] -flags: [async] ----*/ - -import('./2nd-param_FIXTURE.js',) - .then(function(module) { - assert.sameValue(module.default, 262); - }) - .then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/import-assertions/trailing-comma-reject.js b/test/language/expressions/dynamic-import/import-assertions/trailing-comma-reject.js deleted file mode 100644 index d257eccc32..0000000000 --- a/test/language/expressions/dynamic-import/import-assertions/trailing-comma-reject.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - ImportCall parameter list supports an optional trailing comma (rejection - semantics) -esid: sec-import-call-runtime-semantics-evaluation -info: | - ImportCall[Yield, Await]: - import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt ) - import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt ) -features: [dynamic-import, import-assertions] -flags: [async] ----*/ - -var thrown = new Test262Error(); - -import({toString: function() { throw thrown; } },) - .then(function() { - throw new Test262Error('Expected promise to be rejected, but it was fulfilled.'); - }, function(caught) { - assert.sameValue(thrown, caught); - }) - .then($DONE, $DONE); diff --git a/test/language/import/import-assertions/README.md b/test/language/import/import-assertions/README.md deleted file mode 100644 index d80cf27f8e..0000000000 --- a/test/language/import/import-assertions/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Make sure to keep the tests in this folder aligned -with the tests in the import-attributes folder. diff --git a/test/language/import/import-assertions/json-extensibility-array.js b/test/language/import/import-assertions/json-extensibility-array.js deleted file mode 100644 index 4dc80018b9..0000000000 --- a/test/language/import/import-assertions/json-extensibility-array.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Creates extensible arrays -flags: [module] -includes: [propertyHelper.js] -features: [import-assertions, json-modules] ----*/ - -import value from './json-value-array_FIXTURE.json' assert { type: 'json' }; - -value.test262property = 'test262 value'; - -verifyProperty(value, 'test262property', { - value: 'test262 value', - writable: true, - enumerable: true, - configurable: true -}); diff --git a/test/language/import/import-assertions/json-extensibility-object.js b/test/language/import/import-assertions/json-extensibility-object.js deleted file mode 100644 index fb4c8ed2c4..0000000000 --- a/test/language/import/import-assertions/json-extensibility-object.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Creates extensible objects -flags: [module] -includes: [propertyHelper.js] -features: [import-assertions, json-modules] ----*/ - -import value from './json-value-object_FIXTURE.json' assert { type: 'json' }; - -value.test262property = 'test262 value'; - -verifyProperty(value, 'test262property', { - value: 'test262 value', - writable: true, - enumerable: true, - configurable: true -}); diff --git a/test/language/import/import-assertions/json-idempotency-indirect_FIXTURE.js b/test/language/import/import-assertions/json-idempotency-indirect_FIXTURE.js deleted file mode 100644 index 61c440b333..0000000000 --- a/test/language/import/import-assertions/json-idempotency-indirect_FIXTURE.js +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -import value from './json-idempotency_FIXTURE.json' assert { type: 'json' }; - -globalThis.viaSecondModule = value; diff --git a/test/language/import/import-assertions/json-idempotency.js b/test/language/import/import-assertions/json-idempotency.js deleted file mode 100644 index 54832a1cad..0000000000 --- a/test/language/import/import-assertions/json-idempotency.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: The same object representation is returned to all import sites -flags: [module, async] -features: [import-assertions, json-modules, globalThis, dynamic-import] ----*/ - -import viaStaticImport1 from './json-idempotency_FIXTURE.json' assert { type: 'json' }; -import {default as viaStaticImport2} from './json-idempotency_FIXTURE.json' assert { type: 'json' }; -import './json-idempotency-indirect_FIXTURE.js'; - -assert.sameValue(viaStaticImport1, viaStaticImport2); -assert.sameValue(globalThis.viaSecondModule, viaStaticImport1); - -import('./json-idempotency_FIXTURE.json', { assert: { type: 'json' } }) - .then(function(viaDynamicImport) { - assert.sameValue(viaDynamicImport.default, viaStaticImport1); - }) - .then($DONE, $DONE); diff --git a/test/language/import/import-assertions/json-idempotency_FIXTURE.json b/test/language/import/import-assertions/json-idempotency_FIXTURE.json deleted file mode 100644 index 0967ef424b..0000000000 --- a/test/language/import/import-assertions/json-idempotency_FIXTURE.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/test/language/import/import-assertions/json-invalid.js b/test/language/import/import-assertions/json-invalid.js deleted file mode 100644 index 855d8566f7..0000000000 --- a/test/language/import/import-assertions/json-invalid.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Does not define -info: | - # 1.4 ParseJSONModule ( source ) - - The abstract operation ParseJSONModule takes a single argument source which - is a String representing the contents of a module. - - 1. Let json be ? Call(%JSON.parse%, undefined, « source »). - 2. Return CreateDefaultExportSyntheticModule(json). -flags: [module] -features: [import-assertions, json-modules] -negative: - phase: parse - type: SyntaxError ----*/ - -$DONOTEVALUATE(); - -import value from './json-invalid_FIXTURE.json' assert { type: 'json' }; diff --git a/test/language/import/import-assertions/json-invalid_FIXTURE.json b/test/language/import/import-assertions/json-invalid_FIXTURE.json deleted file mode 100644 index 64809bccc4..0000000000 --- a/test/language/import/import-assertions/json-invalid_FIXTURE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - notJson: 0 -} diff --git a/test/language/import/import-assertions/json-named-bindings.js b/test/language/import/import-assertions/json-named-bindings.js deleted file mode 100644 index 7900fe38f8..0000000000 --- a/test/language/import/import-assertions/json-named-bindings.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Does not define named bindings -info: | - In the early design of JSON modules, contributors considered allowing the - properties of object values in JSON modules to be imported directly by name. - This was ultimately rejected, so attempting to import in this way should - produce a SyntaxError. -flags: [module] -features: [import-assertions, json-modules] -negative: - phase: parse - type: SyntaxError ----*/ - -$DONOTEVALUATE(); - -import {name} from './json-named-bindings_FIXTURE.json' assert { type: 'json' }; diff --git a/test/language/import/import-assertions/json-named-bindings_FIXTURE.json b/test/language/import/import-assertions/json-named-bindings_FIXTURE.json deleted file mode 100644 index ead2bb7c66..0000000000 --- a/test/language/import/import-assertions/json-named-bindings_FIXTURE.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "name": 0 -} diff --git a/test/language/import/import-assertions/json-value-array.js b/test/language/import/import-assertions/json-value-array.js deleted file mode 100644 index 90d64b96d9..0000000000 --- a/test/language/import/import-assertions/json-value-array.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Correctly parses the JSON representation of an array -info: | - # 1.4 ParseJSONModule ( source ) - - The abstract operation ParseJSONModule takes a single argument source which - is a String representing the contents of a module. - - 1. Let json be ? Call(%JSON.parse%, undefined, « source »). - 2. Return CreateDefaultExportSyntheticModule(json). - - To more fully verify parsing correctness, the source text of the imported - module record includes non-printable characters (specifically, all four forms - of JSON's so-called "whitespace" token) both before and after the "value." -flags: [module] -features: [import-assertions, json-modules] ----*/ - -import value from './json-value-array_FIXTURE.json' assert { type: 'json' }; - -assert(Array.isArray(value), 'the exported value is an array'); -assert.sameValue( - Object.getPrototypeOf(value), - Array.prototype, - 'the exported value is not a subclass of Array' -); -assert.sameValue(Object.getOwnPropertyNames(value).length, 7); -assert.sameValue(value.length, 6); - -assert.sameValue(value[0], -1.2345); -assert.sameValue(value[1], true); -assert.sameValue(value[2], 'a string value'); -assert.sameValue(value[3], null); - -assert.sameValue(Object.getPrototypeOf(value[4]), Object.prototype); -assert.sameValue(Object.getOwnPropertyNames(value[4]).length, 0); - -assert(Array.isArray(value[5]), 'the fifth element is an array'); -assert.sameValue( - Object.getPrototypeOf(value[5]), - Array.prototype, - 'the fifth element is not a subclass of Array' -); -assert.sameValue(Object.getOwnPropertyNames(value[5]).length, 1); diff --git a/test/language/import/import-assertions/json-value-array_FIXTURE.json b/test/language/import/import-assertions/json-value-array_FIXTURE.json deleted file mode 100644 index 9520048793..0000000000 --- a/test/language/import/import-assertions/json-value-array_FIXTURE.json +++ /dev/null @@ -1,10 +0,0 @@ - - [ - -1234.500e-003, - true, - "a string value", - null, - {}, - [] -] - diff --git a/test/language/import/import-assertions/json-value-boolean.js b/test/language/import/import-assertions/json-value-boolean.js deleted file mode 100644 index 0ab3fd371e..0000000000 --- a/test/language/import/import-assertions/json-value-boolean.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Correctly parses the JSON representation of a boolean -info: | - # 1.4 ParseJSONModule ( source ) - - The abstract operation ParseJSONModule takes a single argument source which - is a String representing the contents of a module. - - 1. Let json be ? Call(%JSON.parse%, undefined, « source »). - 2. Return CreateDefaultExportSyntheticModule(json). -flags: [module] -features: [import-assertions, json-modules] ----*/ - -import value from './json-value-boolean_FIXTURE.json' assert { type: 'json' }; - -assert.sameValue(value, true); diff --git a/test/language/import/import-assertions/json-value-boolean_FIXTURE.json b/test/language/import/import-assertions/json-value-boolean_FIXTURE.json deleted file mode 100644 index 27ba77ddaf..0000000000 --- a/test/language/import/import-assertions/json-value-boolean_FIXTURE.json +++ /dev/null @@ -1 +0,0 @@ -true diff --git a/test/language/import/import-assertions/json-value-null.js b/test/language/import/import-assertions/json-value-null.js deleted file mode 100644 index cb651b33b0..0000000000 --- a/test/language/import/import-assertions/json-value-null.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Correctly parses the JSON representation of null -info: | - # 1.4 ParseJSONModule ( source ) - - The abstract operation ParseJSONModule takes a single argument source which - is a String representing the contents of a module. - - 1. Let json be ? Call(%JSON.parse%, undefined, « source »). - 2. Return CreateDefaultExportSyntheticModule(json). -flags: [module] -features: [import-assertions, json-modules] ----*/ - -import value from './json-value-null_FIXTURE.json' assert { type: 'json' }; - -assert.sameValue(value, null); diff --git a/test/language/import/import-assertions/json-value-null_FIXTURE.json b/test/language/import/import-assertions/json-value-null_FIXTURE.json deleted file mode 100644 index 19765bd501..0000000000 --- a/test/language/import/import-assertions/json-value-null_FIXTURE.json +++ /dev/null @@ -1 +0,0 @@ -null diff --git a/test/language/import/import-assertions/json-value-number.js b/test/language/import/import-assertions/json-value-number.js deleted file mode 100644 index da4cada9d2..0000000000 --- a/test/language/import/import-assertions/json-value-number.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Correctly parses the JSON representation of a number -info: | - # 1.4 ParseJSONModule ( source ) - - The abstract operation ParseJSONModule takes a single argument source which - is a String representing the contents of a module. - - 1. Let json be ? Call(%JSON.parse%, undefined, « source »). - 2. Return CreateDefaultExportSyntheticModule(json). -flags: [module] -features: [import-assertions, json-modules] ----*/ - -import value from './json-value-number_FIXTURE.json' assert { type: 'json' }; - -assert.sameValue(value, -1.2345); diff --git a/test/language/import/import-assertions/json-value-number_FIXTURE.json b/test/language/import/import-assertions/json-value-number_FIXTURE.json deleted file mode 100644 index 859603baed..0000000000 --- a/test/language/import/import-assertions/json-value-number_FIXTURE.json +++ /dev/null @@ -1 +0,0 @@ --1234.500e-003 diff --git a/test/language/import/import-assertions/json-value-object.js b/test/language/import/import-assertions/json-value-object.js deleted file mode 100644 index 815ab9f896..0000000000 --- a/test/language/import/import-assertions/json-value-object.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Correctly parses the JSON representation of an ordinary object -info: | - # 1.4 ParseJSONModule ( source ) - - The abstract operation ParseJSONModule takes a single argument source which - is a String representing the contents of a module. - - 1. Let json be ? Call(%JSON.parse%, undefined, « source »). - 2. Return CreateDefaultExportSyntheticModule(json). - - To more fully verify parsing correctness, the source text of the imported - module record includes non-printable characters (specifically, all four forms - of JSON's so-called "whitespace" token) both before and after the "value." -flags: [module] -includes: [propertyHelper.js] -features: [import-assertions, json-modules] ----*/ - -import value from './json-value-object_FIXTURE.json' assert { type: 'json' }; - -assert.sameValue(Object.getPrototypeOf(value), Object.prototype); -assert.sameValue(Object.getOwnPropertyNames(value).length, 6); - -verifyProperty(value, 'number', { - value: -1.2345, - writable: true, - enumerable: true, - configurable: true -}); - -verifyProperty(value, 'boolean', { - value: true, - writable: true, - enumerable: true, - configurable: true -}); - -verifyProperty(value, 'string', { - value: 'a string value', - writable: true, - enumerable: true, - configurable: true -}); - -verifyProperty(value, 'null', { - value: null, - writable: true, - enumerable: true, - configurable: true -}); - -assert.sameValue(Object.getPrototypeOf(value.object), Object.prototype); -assert.sameValue(Object.getOwnPropertyNames(value.object).length, 0); - -assert( - Array.isArray(value.array), 'the value of the "array" property is an array' -); -assert.sameValue( - Object.getPrototypeOf(value.array), - Array.prototype, - 'the value of the "array" property is not a subclass of Array' -); -assert.sameValue(Object.getOwnPropertyNames(value.array).length, 1); diff --git a/test/language/import/import-assertions/json-value-object_FIXTURE.json b/test/language/import/import-assertions/json-value-object_FIXTURE.json deleted file mode 100644 index 814ec45e4d..0000000000 --- a/test/language/import/import-assertions/json-value-object_FIXTURE.json +++ /dev/null @@ -1,10 +0,0 @@ - - { - "number": -1234.500e-003, - "boolean": true, - "string": "a string value", - "null": null, - "object": {}, - "array": [] -} - diff --git a/test/language/import/import-assertions/json-value-string.js b/test/language/import/import-assertions/json-value-string.js deleted file mode 100644 index ce0ebcf323..0000000000 --- a/test/language/import/import-assertions/json-value-string.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: Correctly parses the JSON representation of a string -info: | - # 1.4 ParseJSONModule ( source ) - - The abstract operation ParseJSONModule takes a single argument source which - is a String representing the contents of a module. - - 1. Let json be ? Call(%JSON.parse%, undefined, « source »). - 2. Return CreateDefaultExportSyntheticModule(json). -flags: [module] -features: [import-assertions, json-modules] ----*/ - -import value from './json-value-string_FIXTURE.json' assert { type: 'json' }; - -assert.sameValue(value, 'a string value'); diff --git a/test/language/import/import-assertions/json-value-string_FIXTURE.json b/test/language/import/import-assertions/json-value-string_FIXTURE.json deleted file mode 100644 index d98e333143..0000000000 --- a/test/language/import/import-assertions/json-value-string_FIXTURE.json +++ /dev/null @@ -1 +0,0 @@ -"a string value" diff --git a/test/language/import/import-assertions/json-via-namespace.js b/test/language/import/import-assertions/json-via-namespace.js deleted file mode 100644 index f0eedb379b..0000000000 --- a/test/language/import/import-assertions/json-via-namespace.js +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -esid: sec-parse-json-module -description: May be imported via a module namespace object -flags: [module] -features: [import-assertions, json-modules] ----*/ - -import * as ns from './json-via-namespace_FIXTURE.json' assert { type: 'json' }; - -assert.sameValue(Object.getOwnPropertyNames(ns).length, 1); -assert.sameValue(ns.default, 262); diff --git a/test/language/import/import-assertions/json-via-namespace_FIXTURE.json b/test/language/import/import-assertions/json-via-namespace_FIXTURE.json deleted file mode 100644 index 5484d82917..0000000000 --- a/test/language/import/import-assertions/json-via-namespace_FIXTURE.json +++ /dev/null @@ -1 +0,0 @@ -262 diff --git a/test/language/module-code/import-assertions/README.md b/test/language/module-code/import-assertions/README.md deleted file mode 100644 index d80cf27f8e..0000000000 --- a/test/language/module-code/import-assertions/README.md +++ /dev/null @@ -1,2 +0,0 @@ -Make sure to keep the tests in this folder aligned -with the tests in the import-attributes folder. diff --git a/test/language/module-code/import-assertions/early-dup-assert-key-export.js b/test/language/module-code/import-assertions/early-dup-assert-key-export.js deleted file mode 100644 index 9f44e359a0..0000000000 --- a/test/language/module-code/import-assertions/early-dup-assert-key-export.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: WithClause may not have duplicate keys (export declaration) -esid: sec-modules -info: | - WithClause: AttributesKeyword { WithEntries,opt } - - - It is a Syntax Error if WithClauseToAttributes of WithClause has two - entries a and b such that a.[[Key]] is b.[[Key]]. -features: [import-assertions] -flags: [module] -negative: - phase: parse - type: SyntaxError ----*/ - -$DONOTEVALUATE(); - -export * from './import-assertion-3_FIXTURE.js' assert { - type: 'json', - 'typ\u0065': '' -}; diff --git a/test/language/module-code/import-assertions/early-dup-assert-key-import-nobinding.js b/test/language/module-code/import-assertions/early-dup-assert-key-import-nobinding.js deleted file mode 100644 index 7c48699630..0000000000 --- a/test/language/module-code/import-assertions/early-dup-assert-key-import-nobinding.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause may not have duplicate keys (import declaration without binding) -esid: sec-modules -info: | - WithClause: AttributesKeyword { WithEntries,opt } - - - It is a Syntax Error if WithClauseToAttributes of WithClause has two - entries a and b such that a.[[Key]] is b.[[Key]]. -features: [import-assertions] -flags: [module] -negative: - phase: parse - type: SyntaxError ----*/ - -$DONOTEVALUATE(); - -import './import-assertion-2_FIXTURE.js' assert { - type: 'json', - 'typ\u0065': '' -}; diff --git a/test/language/module-code/import-assertions/early-dup-assert-key-import-withbinding.js b/test/language/module-code/import-assertions/early-dup-assert-key-import-withbinding.js deleted file mode 100644 index 0874455882..0000000000 --- a/test/language/module-code/import-assertions/early-dup-assert-key-import-withbinding.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause may not have duplicate keys (import declaration with binding) -esid: sec-modules -info: | - WithClause: AttributesKeyword { WithEntries,opt } - - - It is a Syntax Error if WithClauseToAttributes of WithClause has two - entries a and b such that a.[[Key]] is b.[[Key]]. -features: [import-assertions] -flags: [module] -negative: - phase: parse - type: SyntaxError ----*/ - -$DONOTEVALUATE(); - -import x from './import-assertion-1_FIXTURE.js' assert { - type: 'json', - 'typ\u0065': '' -}; diff --git a/test/language/module-code/import-assertions/eval-gtbndng-indirect-faux-assertion.js b/test/language/module-code/import-assertions/eval-gtbndng-indirect-faux-assertion.js deleted file mode 100644 index 46b6069510..0000000000 --- a/test/language/module-code/import-assertions/eval-gtbndng-indirect-faux-assertion.js +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - `assert` AttributesKeyword in WithClause in ImportDeclaration may not - be preceded by a line terminator -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - AttributesKeyword {} - AttributesKeyword { WithEntries ,opt } - - AttributesKeyword: - with - [no LineTerminator here] assert - - The restriction LineTerminator could be verified more simply with a negative - syntax test. This test is designed to parse successfully in order to verify - the restriction more precisely. -features: [import-assertions, globalThis] -flags: [module, raw] ----*/ - -var callCount = 0; - -// Define a property on the global "this" value so that the effect of the -// expected IdentifierReference can be observed. -Object.defineProperty(globalThis, 'assert', { - get: function() { - callCount += 1; - } -}); - -import * as x from './import-assertion-1_FIXTURE.js' -assert -{ type: 'json' }; - -if (x.default !== 262.1) { - throw 'module value incorrectly imported - first declaration'; -} - -if (callCount !== 1) { - throw 'IdentifierReference not recognized - first declaration'; -} diff --git a/test/language/module-code/import-assertions/import-assertion-1_FIXTURE.js b/test/language/module-code/import-assertions/import-assertion-1_FIXTURE.js deleted file mode 100644 index 3e4b8af7ff..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-1_FIXTURE.js +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -export default 262.1; diff --git a/test/language/module-code/import-assertions/import-assertion-2_FIXTURE.js b/test/language/module-code/import-assertions/import-assertion-2_FIXTURE.js deleted file mode 100644 index a717e7ac57..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-2_FIXTURE.js +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -export default 262.2; diff --git a/test/language/module-code/import-assertions/import-assertion-3_FIXTURE.js b/test/language/module-code/import-assertions/import-assertion-3_FIXTURE.js deleted file mode 100644 index 376f79094d..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-3_FIXTURE.js +++ /dev/null @@ -1,3 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -export default 262.3; diff --git a/test/language/module-code/import-assertions/import-assertion-empty.js b/test/language/module-code/import-assertions/import-assertion-empty.js deleted file mode 100644 index 11ba46ac7c..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-empty.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: WithClause in ImportDeclaration may be empty -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - assert {} - assert {WithEntries ,opt} - - WithEntries: - AttributeKey : StringLiteral - AttributeKey : StringLiteral , WithEntries - - AttributeKey: - IdentifierName - StringLiteral -features: [import-assertions, globalThis] -flags: [module] ----*/ - -import x from './import-assertion-1_FIXTURE.js' assert {}; -import './import-assertion-2_FIXTURE.js' assert {}; -export * from './import-assertion-3_FIXTURE.js' assert {}; - -assert.sameValue(x, 262.1); diff --git a/test/language/module-code/import-assertions/import-assertion-key-identifiername.js b/test/language/module-code/import-assertions/import-assertion-key-identifiername.js deleted file mode 100644 index 43cdf8b1e2..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-key-identifiername.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause in ImportDeclaration may use any valid IdentifierName as a key -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - assert {} - assert {WithEntries ,opt} - - WithEntries: - AttributeKey : StringLiteral - AttributeKey : StringLiteral , WithEntries - - AttributeKey: - IdentifierName - StringLiteral -negative: - phase: resolution - type: SyntaxError -features: [import-assertions] -flags: [module] ----*/ - -$DONOTEVALUATE(); - -import "../resources/ensure-linking-error_FIXTURE.js"; - -import x from './import-assertion-1_FIXTURE.js' assert {if:''}; -import './import-assertion-2_FIXTURE.js' assert {if:''}; -export * from './import-assertion-3_FIXTURE.js' assert {if:''}; - -assert.sameValue(x, 262.1); diff --git a/test/language/module-code/import-assertions/import-assertion-key-string-double.js b/test/language/module-code/import-assertions/import-assertion-key-string-double.js deleted file mode 100644 index 2aaf7c4776..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-key-string-double.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause in ImportDeclaration may use a string literal as a key (delimited with U+0022) -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - assert {} - assert {WithEntries ,opt} - - WithEntries: - AttributeKey : StringLiteral - AttributeKey : StringLiteral , WithEntries - - AttributeKey: - IdentifierName - StringLiteral -negative: - phase: resolution - type: SyntaxError -features: [import-assertions, globalThis] -flags: [module] ----*/ - -$DONOTEVALUATE(); - -import "../resources/ensure-linking-error_FIXTURE.js"; - -import x from './import-assertion-1_FIXTURE.js' assert {"test262\u0078":''}; -import './import-assertion-2_FIXTURE.js' assert {"test262\u0078":''}; -export * from './import-assertion-3_FIXTURE.js' assert {"test262\u0078":''}; - -assert.sameValue(x, 262.1); diff --git a/test/language/module-code/import-assertions/import-assertion-key-string-single.js b/test/language/module-code/import-assertions/import-assertion-key-string-single.js deleted file mode 100644 index d4cb0abb7a..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-key-string-single.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause in ImportDeclaration may use a string literal as a key (delimited with U+0027) -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - assert {} - assert {WithEntries ,opt} - - WithEntries: - AttributeKey : StringLiteral - AttributeKey : StringLiteral , WithEntries - - AttributeKey: - IdentifierName - StringLiteral -negative: - phase: resolution - type: SyntaxError -features: [import-assertions, globalThis] -flags: [module] ----*/ - -$DONOTEVALUATE(); - -import "../resources/ensure-linking-error_FIXTURE.js"; - -import x from './import-assertion-1_FIXTURE.js' assert {'test262\u0078':''}; -import './import-assertion-2_FIXTURE.js' assert {'test262\u0078':''}; -export * from './import-assertion-3_FIXTURE.js' assert {'test262\u0078':''}; - -assert.sameValue(x, 262.1); diff --git a/test/language/module-code/import-assertions/import-assertion-many.js b/test/language/module-code/import-assertions/import-assertion-many.js deleted file mode 100644 index b970515c4f..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-many.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause in ImportDeclaration may contain multiple WithEntries -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - assert {} - assert {WithEntries ,opt} - - WithEntries: - AttributeKey : StringLiteral - AttributeKey : StringLiteral , WithEntries - - AttributeKey: - IdentifierName - StringLiteral -negative: - phase: resolution - type: SyntaxError -features: [import-assertions, globalThis] -flags: [module] ----*/ - -$DONOTEVALUATE(); - -import "../resources/ensure-linking-error_FIXTURE.js"; - -import x from './import-assertion-1_FIXTURE.js' assert {test262_1:'',test262_2:'',test262_3:'',test262_4:''}; -import './import-assertion-2_FIXTURE.js' assert {test262_1:'',test262_2:'',test262_3:'',test262_4:''}; -export * from './import-assertion-3_FIXTURE.js' assert {test262_1:'',test262_2:'',test262_3:'',test262_4:''}; diff --git a/test/language/module-code/import-assertions/import-assertion-newlines.js b/test/language/module-code/import-assertions/import-assertion-newlines.js deleted file mode 100644 index b7896d9adf..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-newlines.js +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause in ImportDeclaration may include line terminators -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - assert {} - assert {WithEntries ,opt} - - WithEntries: - AttributeKey : StringLiteral - AttributeKey : StringLiteral , WithEntries - - AttributeKey: - IdentifierName - StringLiteral - - This test uses all four LineFeed characters in order to completely verify the - grammar. -negative: - phase: resolution - type: SyntaxError -features: [import-assertions, globalThis] -flags: [module] ----*/ - -$DONOTEVALUATE(); - -import "../resources/ensure-linking-error_FIXTURE.js"; - -import x from './import-assertion-1_FIXTURE.js' assert - -

{ - -

test262 - -

: - -

'' - -

}; -import './import-assertion-2_FIXTURE.js' assert - -

{ - -

test262 - -

: - -

'' - -

}; -export * from './import-assertion-3_FIXTURE.js' assert - -

{ - -

test262 - -

: - -

'' - -

}; - -assert.sameValue(x, 262.1); -assert.sameValue(globalThis.test262, 262.2); diff --git a/test/language/module-code/import-assertions/import-assertion-trlng-comma.js b/test/language/module-code/import-assertions/import-assertion-trlng-comma.js deleted file mode 100644 index 89d0733df7..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-trlng-comma.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause in ImportDeclaration may contain a trailing comma -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - assert {} - assert {WithEntries ,opt} - - WithEntries: - AttributeKey : StringLiteral - AttributeKey : StringLiteral , WithEntries - - AttributeKey: - IdentifierName - StringLiteral -negative: - phase: resolution - type: SyntaxError -features: [import-assertions, globalThis] -flags: [module] ----*/ - -$DONOTEVALUATE(); - -import "../resources/ensure-linking-error_FIXTURE.js"; - -import x from './import-assertion-1_FIXTURE.js' assert {test262:'',}; -import './import-assertion-2_FIXTURE.js' assert {test262:'',}; -export * from './import-assertion-3_FIXTURE.js' assert {test262:'',}; diff --git a/test/language/module-code/import-assertions/import-assertion-value-string-double.js b/test/language/module-code/import-assertions/import-assertion-value-string-double.js deleted file mode 100644 index 0ce091ae30..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-value-string-double.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause in ImportDeclaration may use a string literal as a value (delimited with U+0022) -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - assert {} - assert {WithEntries ,opt} - - WithEntries: - AttributeKey : StringLiteral - AttributeKey : StringLiteral , WithEntries - - AttributeKey: - IdentifierName - StringLiteral -negative: - phase: resolution - type: SyntaxError -features: [import-assertions, globalThis] -flags: [module] ----*/ - -$DONOTEVALUATE(); - -import "../resources/ensure-linking-error_FIXTURE.js"; - -import x from './import-assertion-1_FIXTURE.js' assert {test262:"\u0078"}; -import './import-assertion-2_FIXTURE.js' assert {test262:"\u0078"}; -export * from './import-assertion-3_FIXTURE.js' assert {test262:"\u0078"}; diff --git a/test/language/module-code/import-assertions/import-assertion-value-string-single.js b/test/language/module-code/import-assertions/import-assertion-value-string-single.js deleted file mode 100644 index c12e13c9ac..0000000000 --- a/test/language/module-code/import-assertions/import-assertion-value-string-single.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2021 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - WithClause in ImportDeclaration may use a string literal as a value (delimited with U+0027) -esid: sec-modules -info: | - ImportDeclaration: - import ModuleSpecifier[no LineTerminator here] WithClause; - - WithClause: - assert {} - assert {WithEntries ,opt} - - WithEntries: - AttributeKey : StringLiteral - AttributeKey : StringLiteral , WithEntries - - AttributeKey: - IdentifierName - StringLiteral -features: [import-assertions, globalThis] -negative: - phase: resolution - type: SyntaxError -flags: [module] ----*/ - -$DONOTEVALUATE(); - -import "../resources/ensure-linking-error_FIXTURE.js"; - -import x from './import-assertion-1_FIXTURE.js' assert {test262:'\u0078'}; -import './import-assertion-2_FIXTURE.js' assert {test262:'\u0078'}; -export * from './import-assertion-3_FIXTURE.js' assert {test262:'\u0078'};