mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-03 23:00:58 +00:00 
			
		
		
		
	
		
			
	
	
		
			17 lines
		
	
	
	
		
			541 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
		
		
			
		
	
	
			17 lines
		
	
	
	
		
			541 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 
								 | 
							
								test("use with array", () => {
							 | 
						||
| 
								 | 
							
								    let names = Object.getOwnPropertySymbols([1, 2, 3]);
							 | 
						||
| 
								 | 
							
								    console.log(names);
							 | 
						||
| 
								 | 
							
								    expect(names).toEqual([]);
							 | 
						||
| 
								 | 
							
								});
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								test("use with object", () => {
							 | 
						||
| 
								 | 
							
								    let names = Object.getOwnPropertySymbols({ [Symbol.iterator]: 1, [Symbol.species]: 2 });
							 | 
						||
| 
								 | 
							
								    expect(names).toEqual([Symbol.iterator, Symbol.species]);
							 | 
						||
| 
								 | 
							
								});
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								test("use with object with string keys", () => {
							 | 
						||
| 
								 | 
							
								    let symbol = Symbol("bar");
							 | 
						||
| 
								 | 
							
								    let names = Object.getOwnPropertySymbols({ foo: 1, [symbol]: 2, baz: 3 });
							 | 
						||
| 
								 | 
							
								    expect(names).toEqual([symbol]);
							 | 
						||
| 
								 | 
							
								});
							 |