v8  9.0.257(node16.0.0)
V8 is Google's open source JavaScript engine
FastApiCallbackOptions Struct Reference

#include <v8-fast-api-calls.h>

Collaboration diagram for FastApiCallbackOptions:

Data Fields

bool fallback
const ApiObject data

Detailed Description

A struct which may be passed to a fast call callback, like so:

void FastMethodWithOptions(int param, FastApiCallbackOptions& options);

Definition at line 253 of file v8-fast-api-calls.h.

Field Documentation

◆ data

const ApiObject data

The data passed to the FunctionTemplate constructor, or undefined.

Definition at line 270 of file v8-fast-api-calls.h.

◆ fallback

bool fallback

If the callback wants to signal an error condition or to perform an allocation, it must set options.fallback to true and do an early return from the fast method. Then V8 checks the value of options.fallback and if it's true, falls back to executing the SlowCallback, which is capable of reporting the error (either by throwing a JS exception or logging to the console) or doing the allocation. It's the embedder's responsibility to ensure that the fast callback is idempotent up to the point where error and fallback conditions are checked, because otherwise executing the slow callback might produce visible side-effects twice.

Definition at line 265 of file v8-fast-api-calls.h.

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