mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-25 09:30:01 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
	
		
			417 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
	
		
			417 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| test("Issue #1992, shrinking array during find() iteration", () => {
 | |
|     var a, callbackCalled;
 | |
| 
 | |
|     callbackCalled = 0;
 | |
|     a = [1, 2, 3, 4, 5];
 | |
|     a.find(() => {
 | |
|         callbackCalled++;
 | |
|         a.pop();
 | |
|     });
 | |
|     expect(callbackCalled).toBe(5);
 | |
| 
 | |
|     callbackCalled = 0;
 | |
|     a = [1, 2, 3, 4, 5];
 | |
|     a.findIndex(() => {
 | |
|         callbackCalled++;
 | |
|         a.pop();
 | |
|     });
 | |
|     expect(callbackCalled).toBe(5);
 | |
| });
 |