v8  5.8.282(node8.0.0)
V8 is Google's open source JavaScript engine
MicrotasksScope Class Reference

#include <v8.h>

Public Types

enum  Type { kRunMicrotasks, kDoNotRunMicrotasks }
 

Public Member Functions

 MicrotasksScope (Isolate *isolate, Type type)
 
 ~MicrotasksScope ()
 
 MicrotasksScope (const MicrotasksScope &)=delete
 
MicrotasksScopeoperator= (const MicrotasksScope &)=delete
 

Static Public Member Functions

static void PerformCheckpoint (Isolate *isolate)
 
static int GetCurrentDepth (Isolate *isolate)
 
static bool IsRunningMicrotasks (Isolate *isolate)
 

Detailed Description

This scope is used to control microtasks when kScopeMicrotasksInvocation is used on Isolate. In this mode every non-primitive call to V8 should be done inside some MicrotasksScope. Microtasks are executed when topmost MicrotasksScope marked as kRunMicrotasks exits. kDoNotRunMicrotasks should be used to annotate calls not intended to trigger microtasks.

Definition at line 5905 of file v8.h.

Member Enumeration Documentation

enum Type
Enumerator
kRunMicrotasks 
kDoNotRunMicrotasks 

Definition at line 5907 of file v8.h.

Constructor & Destructor Documentation

MicrotasksScope ( Isolate isolate,
Type  type 
)
MicrotasksScope ( const MicrotasksScope )
delete

Member Function Documentation

static int GetCurrentDepth ( Isolate isolate)
static

Returns current depth of nested kRunMicrotasks scopes.

static bool IsRunningMicrotasks ( Isolate isolate)
static

Returns true while microtasks are being executed.

MicrotasksScope& operator= ( const MicrotasksScope )
delete
static void PerformCheckpoint ( Isolate isolate)
static

Runs microtasks if no kRunMicrotasks scope is currently active.


The documentation for this class was generated from the following file: