XeNote/.yarn/unplugged/nan-npm-2.14.2-e3ede8ce5d/node_modules/nan/doc/script.md
canburaks b23e3ff508 ...
2021-05-17 04:16:19 +03: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)