mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 11:44:31 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			23 lines
		
	
	
		
			562 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			562 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Copyright (C) 2015 André Bargull. All rights reserved.
 | |
| // This code is governed by the BSD license found in the LICENSE file.
 | |
| 
 | |
| /*---
 | |
| info: Operator x++ evaluates its reference expression once.
 | |
| description: >
 | |
|     The operand expression is evaluated exactly once. Operand expression is
 | |
|     MemberExpression: base[prop]. ToPropertyKey(prop) is not called multiple
 | |
|     times.
 | |
| ---*/
 | |
| 
 | |
| var propKeyEvaluated = false;
 | |
| var base = {};
 | |
| var prop = {
 | |
|   toString: function() {
 | |
|     assert(!propKeyEvaluated);
 | |
|     propKeyEvaluated = true;
 | |
|     return 1;
 | |
|   }
 | |
| };
 | |
| 
 | |
| base[prop]++;
 |