mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:32:44 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
	
		
			709 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
	
		
			709 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
 | |
|  * Copyright (c) 2021, Luke Wilde <lukew@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <LibJS/Runtime/GlobalObject.h>
 | |
| #include <LibJS/Runtime/JobCallback.h>
 | |
| #include <LibJS/Runtime/NativeFunction.h>
 | |
| #include <LibJS/Runtime/Promise.h>
 | |
| 
 | |
| namespace JS {
 | |
| 
 | |
| struct PromiseJob {
 | |
|     Function<ThrowCompletionOr<Value>()> job;
 | |
|     GCPtr<Realm> realm;
 | |
| };
 | |
| 
 | |
| // NOTE: These return a PromiseJob to prevent awkward casting at call sites.
 | |
| PromiseJob create_promise_reaction_job(VM&, PromiseReaction&, Value argument);
 | |
| PromiseJob create_promise_resolve_thenable_job(VM&, Promise&, Value thenable, JobCallback then);
 | |
| 
 | |
| }
 | 
