mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:22:46 +00:00 
			
		
		
		
	LibWeb: Port the WindowOrWorkerGlobalScopeMixin timer handler to String
This will make porting to IDL a bit cleaner.
This commit is contained in:
		
							parent
							
								
									dd992e7dad
								
							
						
					
					
						commit
						2895b7e733
					
				
					 3 changed files with 3 additions and 3 deletions
				
			
		|  | @ -1370,7 +1370,7 @@ static JS::ThrowCompletionOr<TimerHandler> make_timer_handler(JS::VM& vm, JS::Va | ||||||
| { | { | ||||||
|     if (handler.is_function()) |     if (handler.is_function()) | ||||||
|         return JS::make_handle(vm.heap().allocate_without_realm<WebIDL::CallbackType>(handler.as_function(), incumbent_settings_object())); |         return JS::make_handle(vm.heap().allocate_without_realm<WebIDL::CallbackType>(handler.as_function(), incumbent_settings_object())); | ||||||
|     return TRY(handler.to_deprecated_string(vm)); |     return TRY(handler.to_string(vm)); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
 | // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
 | ||||||
|  |  | ||||||
|  | @ -211,7 +211,7 @@ i32 WindowOrWorkerGlobalScopeMixin::run_timer_initialization_steps(TimerHandler | ||||||
|                     report_exception(result, this_impl().realm()); |                     report_exception(result, this_impl().realm()); | ||||||
|             }, |             }, | ||||||
|             // 3. Otherwise:
 |             // 3. Otherwise:
 | ||||||
|             [&](DeprecatedString const& source) { |             [&](String const& source) { | ||||||
|                 // 1. Assert: handler is a string.
 |                 // 1. Assert: handler is a string.
 | ||||||
|                 // FIXME: 2. Perform HostEnsureCanCompileStrings(callerRealm, calleeRealm). If this throws an exception, catch it, report the exception, and abort these steps.
 |                 // FIXME: 2. Perform HostEnsureCanCompileStrings(callerRealm, calleeRealm). If this throws an exception, catch it, report the exception, and abort these steps.
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -18,7 +18,7 @@ | ||||||
| namespace Web::HTML { | namespace Web::HTML { | ||||||
| 
 | 
 | ||||||
| // https://html.spec.whatwg.org/#timerhandler
 | // https://html.spec.whatwg.org/#timerhandler
 | ||||||
| using TimerHandler = Variant<JS::Handle<WebIDL::CallbackType>, DeprecatedString>; | using TimerHandler = Variant<JS::Handle<WebIDL::CallbackType>, String>; | ||||||
| 
 | 
 | ||||||
| // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
 | // https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
 | ||||||
| class WindowOrWorkerGlobalScopeMixin { | class WindowOrWorkerGlobalScopeMixin { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy Flynn
						Timothy Flynn