mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 13:20:59 +00:00 
			
		
		
		
	Libraries: Move to Userland/Libraries/
This commit is contained in:
		
							parent
							
								
									dc28c07fa5
								
							
						
					
					
						commit
						13d7c09125
					
				
				
				Notes:
				
					sideshowbarker
				
				2024-07-18 23:53:55 +09:00 
				
			
			Author: https://github.com/awesomekling
Commit: 13d7c09125
			
					 1857 changed files with 266 additions and 274 deletions
				
			
		|  | @ -1,47 +0,0 @@ | |||
| test("rest parameter with no arguments", () => { | ||||
|     function foo(...a) { | ||||
|         expect(a).toBeInstanceOf(Array); | ||||
|         expect(a).toHaveLength(0); | ||||
|     } | ||||
|     foo(); | ||||
| }); | ||||
| 
 | ||||
| test("rest parameter with arguments", () => { | ||||
|     function foo(...a) { | ||||
|         expect(a).toEqual(["foo", 123, undefined, { foo: "bar" }]); | ||||
|     } | ||||
|     foo("foo", 123, undefined, { foo: "bar" }); | ||||
| }); | ||||
| 
 | ||||
| test("rest parameter after normal parameters with no arguments", () => { | ||||
|     function foo(a, b, ...c) { | ||||
|         expect(a).toBe("foo"); | ||||
|         expect(b).toBe(123); | ||||
|         expect(c).toEqual([]); | ||||
|     } | ||||
|     foo("foo", 123); | ||||
| }); | ||||
| 
 | ||||
| test("rest parameter after normal parameters with arguments", () => { | ||||
|     function foo(a, b, ...c) { | ||||
|         expect(a).toBe("foo"); | ||||
|         expect(b).toBe(123); | ||||
|         expect(c).toEqual([undefined, { foo: "bar" }]); | ||||
|     } | ||||
|     foo("foo", 123, undefined, { foo: "bar" }); | ||||
| }); | ||||
| 
 | ||||
| test("basic arrow function rest parameters", () => { | ||||
|     let foo = (...a) => { | ||||
|         expect(a).toBeInstanceOf(Array); | ||||
|         expect(a).toHaveLength(0); | ||||
|     }; | ||||
|     foo(); | ||||
| 
 | ||||
|     foo = (a, b, ...c) => { | ||||
|         expect(a).toBe("foo"); | ||||
|         expect(b).toBe(123); | ||||
|         expect(c).toEqual([undefined, { foo: "bar" }]); | ||||
|     }; | ||||
|     foo("foo", 123, undefined, { foo: "bar" }); | ||||
| }); | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling