mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 03:34:08 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			747 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			747 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Copyright (c) 2020 Ecma International.  All rights reserved.
 | |
| // This code is governed by the BSD license found in the LICENSE file.
 | |
| 
 | |
| /*---
 | |
| esid: sec-assignment-operators-runtime-semantics-evaluation
 | |
| description: >
 | |
|     Strict Mode - TypeError is thrown if the LeftHandSide of a Logical
 | |
|     Assignment operator(??=) is a reference to a data property with the
 | |
|     attribute value {[[Writable]]:false} and PutValue step is reached.
 | |
| flags: [onlyStrict]
 | |
| features: [logical-assignment-operators]
 | |
| 
 | |
| ---*/
 | |
| 
 | |
| var obj = {};
 | |
| Object.defineProperty(obj, "prop", {
 | |
|   value: undefined,
 | |
|   writable: false,
 | |
|   enumerable: true,
 | |
|   configurable: true
 | |
| });
 | |
| 
 | |
| assert.throws(TypeError, function() {
 | |
|   obj.prop ??= 1;
 | |
| });
 | |
| assert.sameValue(obj.prop, undefined, "obj.prop");
 |