mirror of
				https://github.com/tc39/test262.git
				synced 2025-10-31 11:44:31 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			367 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			367 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| // Reviewed
 | |
| function test(actual, expected) {
 | |
|     if (actual !== expected)
 | |
|         throw new Error('bad value: ' + actual);
 | |
| }
 | |
| 
 | |
| var global = new Function('return this')();
 | |
| var Cocoa = 'Cocoa';
 | |
| 
 | |
| global[Symbol.unscopables] = {
 | |
|     Cocoa: true
 | |
| };
 | |
| 
 | |
| test(Cocoa, "Cocoa");
 | |
| (function () {
 | |
|     var Cocoa = 'local'
 | |
|     with (global) {
 | |
|         test(Cocoa, "local");
 | |
|     }
 | |
| }());
 |