mirror of
https://github.com/tc39/test262.git
synced 2025-07-28 08:24:23 +02:00
Add case for valid import in a new covered expression
This commit is contained in:
parent
cd9ca65787
commit
ca87891961
@ -0,0 +1,39 @@
|
|||||||
|
// 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 Expression, so it can be wrapped
|
||||||
|
for new expressions, while the same production is not possible without
|
||||||
|
the parentheses wrapping.
|
||||||
|
esid: prod-ImportCall
|
||||||
|
info: |
|
||||||
|
CallExpression:
|
||||||
|
ImportCall
|
||||||
|
|
||||||
|
ImportCall :
|
||||||
|
import( AssignmentExpression[+In, ?Yield] )
|
||||||
|
|
||||||
|
NewExpression :
|
||||||
|
MemberExpression
|
||||||
|
new NewExpression
|
||||||
|
|
||||||
|
MemberExpression :
|
||||||
|
PrimaryExpression
|
||||||
|
|
||||||
|
PrimaryExpression :
|
||||||
|
CoverParenthesizedExpressionAndArrowParameterList
|
||||||
|
features: [dynamic-import]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.throws(TypeError, () => {
|
||||||
|
new (import(''))
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.throws(TypeError, () => {
|
||||||
|
new (function() {}, import(''))
|
||||||
|
});
|
||||||
|
|
||||||
|
assert.sameValue(
|
||||||
|
typeof new (import(''), function() {}),
|
||||||
|
'object',
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user