mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:42:44 +00:00 
			
		
		
		
	 568d53c9b1
			
		
	
	
		568d53c9b1
		
	
	
	
	
		
			
			This fixes two cases obj[expr] and obj[expr]() (MemberExpression and CallExpression respectively) when expr throws an exception and results in an empty value, causing a crash by passing the invalid PropertyName created by computed_property_name() to Object::get() without checking it first. Fixes #3459.
		
			
				
	
	
		
			8 lines
		
	
	
	
		
			219 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			8 lines
		
	
	
	
		
			219 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| test("Issue #3459, exception in computed property expression", () => {
 | |
|     expect(() => {
 | |
|         "foo"[bar];
 | |
|     }).toThrow(ReferenceError);
 | |
|     expect(() => {
 | |
|         "foo"[bar]();
 | |
|     }).toThrow(ReferenceError);
 | |
| });
 |