1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 11:20:19 +00:00
musix-oss/node_modules/nan/doc/script.md
2020-03-03 22:30:50 +02:00

1.3 KiB

Script

NAN provides a v8::Script helpers as the API has changed over the supported versions of V8.

Nan::CompileScript()

A wrapper around v8::ScriptCompiler::Compile().

Note that Nan::BoundScript is an alias for v8::Script.

Signature:

Nan::MaybeLocal<Nan::BoundScript> Nan::CompileScript(
    v8::Local<v8::String> s,
    const v8::ScriptOrigin& origin);
Nan::MaybeLocal<Nan::BoundScript> Nan::CompileScript(v8::Local<v8::String> s);

Nan::RunScript()

Calls script->Run() or script->BindToCurrentContext()->Run(Nan::GetCurrentContext()).

Note that Nan::BoundScript is an alias for v8::Script and Nan::UnboundScript is an alias for v8::UnboundScript where available and v8::Script on older versions of V8.

Signature:

Nan::MaybeLocal<v8::Value> Nan::RunScript(v8::Local<Nan::UnboundScript> script)
Nan::MaybeLocal<v8::Value> Nan::RunScript(v8::Local<Nan::BoundScript> script)