mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-04 15:20:58 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
	
		
			348 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
	
		
			348 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
test("normal mode", () => {
 | 
						|
    expect(() => {
 | 
						|
        NaN = 5; // NaN is a non-writable global variable
 | 
						|
    }).not.toThrow();
 | 
						|
});
 | 
						|
 | 
						|
test("strict mode", () => {
 | 
						|
    expect(() => {
 | 
						|
        "use strict";
 | 
						|
        NaN = 5; // NaN is a non-writable global variable
 | 
						|
    }).toThrowWithMessage(TypeError, "Cannot write to non-writable property 'NaN'");
 | 
						|
});
 |