mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-25 17:53:53 +02:00 
			
		
		
		
	
		
			
				
	
	
		
			40 lines
		
	
	
		
			880 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			880 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // 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',
 | |
| );
 |