mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibWeb: Add option to TemporaryExecutionContext to prepare for callbacks
In the cases where spec authors have us directly interact with promises in a task source context, we need to prepare the backup settings object stack as well as push an actual execution context to the JS VM.
This commit is contained in:
committed by
Alexander Kalenik
parent
2cd93e6b58
commit
1358fe85b0
@@ -15,11 +15,17 @@ namespace Web::HTML {
|
||||
// this is a workaround to temporarily push an execution context.
|
||||
class TemporaryExecutionContext {
|
||||
public:
|
||||
explicit TemporaryExecutionContext(EnvironmentSettingsObject&);
|
||||
enum class CallbacksEnabled {
|
||||
No,
|
||||
Yes,
|
||||
};
|
||||
|
||||
explicit TemporaryExecutionContext(EnvironmentSettingsObject&, CallbacksEnabled = CallbacksEnabled::No);
|
||||
~TemporaryExecutionContext();
|
||||
|
||||
private:
|
||||
EnvironmentSettingsObject& m_environment_settings;
|
||||
CallbacksEnabled m_callbacks_enabled { CallbacksEnabled::No };
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user