mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Add cases for ImportCall syntax reused in CallExpressions
This commit is contained in:
parent
ca87891961
commit
09e608edad
@ -0,0 +1,31 @@
|
||||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: >
|
||||
ImportCall is a CallExpression and can be used before arguments
|
||||
esid: prod-ImportCall
|
||||
info: |
|
||||
CallExpression:
|
||||
ImportCall
|
||||
CallExpression TemplateLiteral
|
||||
CallExpression Arguments
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
// valid syntax, but fails on runtime evaluation
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
import('./empty_FIXTURE.js')();
|
||||
}, 'empty arguments');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
import('./empty_FIXTURE.js')(1,);
|
||||
}, 'arguments with trailing comma');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
import('./empty_FIXTURE.js')(1, 2);
|
||||
}, '2 arguments');
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
import('./empty_FIXTURE.js')(...[]);
|
||||
}, 'spread args');
|
@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2018 Leo Balter. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
description: >
|
||||
ImportCall is a CallExpression and can be used before a template literal
|
||||
esid: prod-ImportCall
|
||||
info: |
|
||||
CallExpression:
|
||||
ImportCall
|
||||
CallExpression TemplateLiteral
|
||||
CallExpression Arguments
|
||||
features: [dynamic-import]
|
||||
---*/
|
||||
|
||||
// valid syntax, but fails on runtime evaluation
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
import('./empty_FIXTURE.js')``;
|
||||
});
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
import('./empty_FIXTURE.js')`something`;
|
||||
});
|
||||
|
||||
assert.throws(TypeError, () => {
|
||||
import('./empty_FIXTURE.js')`${42}`;
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user