mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:42:43 +00:00 
			
		
		
		
	 6eb6752c4c
			
		
	
	
		6eb6752c4c
		
	
	
	
	
		
			
			Since blocks can't be strict by themselves, it makes no sense for them to store whether or not they are strict. Strict-ness is now stored in the Program and FunctionNode ASTNodes. Fixes issue #3641
		
			
				
	
	
		
			22 lines
		
	
	
	
		
			497 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
	
		
			497 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| test("Issue #3641, strict mode should be function- or program-level, not block-level", () => {
 | |
|     function func() {
 | |
|         expect(isStrictMode()).toBeFalse();
 | |
| 
 | |
|         {
 | |
|             "use strict";
 | |
|             expect(isStrictMode()).toBeFalse();
 | |
|         }
 | |
| 
 | |
|         if (true) {
 | |
|             "use strict";
 | |
|             expect(isStrictMode()).toBeFalse();
 | |
|         }
 | |
| 
 | |
|         do {
 | |
|             "use strict";
 | |
|             expect(isStrictMode()).toBeFalse();
 | |
|         } while (false);
 | |
|     }
 | |
| 
 | |
|     func();
 | |
| });
 |