mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 13:32:45 +00:00 
			
		
		
		
	 b5875700e2
			
		
	
	
		b5875700e2
		
	
	
	
	
		
			
			Previously, certain crafted input could cause the JS parser to hang, as it repeatedly tried to parse an EOF token after hitting an "invalid destructuring assignment target" error. This change ensures that we stop parsing after hitting this error condition.
		
			
				
	
	
		
			5 lines
		
	
	
	
		
			183 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			5 lines
		
	
	
	
		
			183 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| test("Assigning to an invalid destructuring assignment target should fail immediately", () => {
 | |
|     expect(() => {
 | |
|         eval("[[function=a{1,}=");
 | |
|     }).toThrow(SyntaxError);
 | |
| });
 |