mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-30 19:24:12 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			480 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			480 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Copyright 2019 Google, Inc.  All rights reserved.
 | |
| // This code is governed by the BSD license found in the LICENSE file.
 | |
| /*---
 | |
| esid: prod-OptionalExpression
 | |
| description: >
 | |
|   optional chain on call expression
 | |
| info: |
 | |
|   Left-Hand-Side Expressions
 | |
|     OptionalExpression:
 | |
|       CallExpression OptionalChain
 | |
| features: [optional-chaining]
 | |
| ---*/
 | |
| 
 | |
| function fn () {
 | |
|   return {a: 33};
 | |
| };
 | |
| 
 | |
| // CallExpression Arguments
 | |
| assert.sameValue(33, fn()?.a);
 | |
| assert.sameValue(undefined, fn()?.b);
 |