mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-04 07:10:57 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
	
		
			319 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
	
		
			319 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
test("basic functionality", () => {
 | 
						|
    let p = new Proxy([], {
 | 
						|
        get(_, key) {
 | 
						|
            if (key === "length")
 | 
						|
                return 3;
 | 
						|
            return Number(key);
 | 
						|
        },
 | 
						|
    });
 | 
						|
 | 
						|
    expect(JSON.stringify(p)).toBe("[0,1,2]");
 | 
						|
    expect(JSON.stringify([[new Proxy(p, {})]])).toBe("[[[0,1,2]]]");
 | 
						|
});
 |