mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 13:20:59 +00:00 
			
		
		
		
	 26c2484c2f
			
		
	
	
		26c2484c2f
		
	
	
	
	
		
			
			This is very similar to the DisposableStack interface, except disposal of resources is promise-based.
		
			
				
	
	
		
			21 lines
		
	
	
	
		
			579 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
	
		
			579 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| test("constructor properties", () => {
 | |
|     expect(AsyncDisposableStack).toHaveLength(0);
 | |
|     expect(AsyncDisposableStack.name).toBe("AsyncDisposableStack");
 | |
| });
 | |
| 
 | |
| describe("errors", () => {
 | |
|     test("called without new", () => {
 | |
|         expect(() => {
 | |
|             AsyncDisposableStack();
 | |
|         }).toThrowWithMessage(
 | |
|             TypeError,
 | |
|             "AsyncDisposableStack constructor must be called with 'new'"
 | |
|         );
 | |
|     });
 | |
| });
 | |
| 
 | |
| describe("normal behavior", () => {
 | |
|     test("typeof", () => {
 | |
|         expect(typeof new AsyncDisposableStack()).toBe("object");
 | |
|     });
 | |
| });
 |