MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / InitError

Function InitError

test/error.cc:400–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398} // end anonymous namespace
399
400Object InitError(Env env) {
401 Object exports = Object::New(env);
402 exports["throwApiError"] = Function::New(env, ThrowApiError);
403 exports["testErrorCopySemantics"] =
404 Function::New(env, TestErrorCopySemantics);
405 exports["testErrorMoveSemantics"] =
406 Function::New(env, TestErrorMoveSemantics);
407 exports["lastExceptionErrorCode"] =
408 Function::New(env, LastExceptionErrorCode);
409 exports["throwJSError"] = Function::New(env, ThrowJSError);
410 exports["throwTypeError"] = Function::New(env, ThrowTypeError);
411 exports["throwTypeErrorCtor"] = Function::New(env, ThrowTypeErrorCtor);
412 exports["throwTypeErrorCStr"] = Function::New(env, ThrowTypeErrorCStr);
413 exports["throwRangeError"] = Function::New(env, ThrowRangeError);
414 exports["throwRangeErrorCtor"] = Function::New(env, ThrowRangeErrorCtor);
415 exports["throwRangeErrorCStr"] = Function::New(env, ThrowRangeErrorCStr);
416 exports["throwEmptyRangeError"] = Function::New(env, ThrowEmptyRangeError);
417#if NAPI_VERSION > 8
418 exports["throwSyntaxError"] = Function::New(env, ThrowSyntaxError);
419 exports["throwSyntaxErrorCtor"] = Function::New(env, ThrowSyntaxErrorCtor);
420 exports["throwSyntaxErrorCStr"] = Function::New(env, ThrowSyntaxErrorCStr);
421#endif // NAPI_VERSION > 8
422 exports["catchError"] = Function::New(env, CatchError);
423 exports["catchErrorMessage"] = Function::New(env, CatchErrorMessage);
424 exports["doNotCatch"] = Function::New(env, DoNotCatch);
425 exports["catchAndRethrowError"] = Function::New(env, CatchAndRethrowError);
426 exports["throwErrorThatEscapesScope"] =
427 Function::New(env, ThrowErrorThatEscapesScope);
428 exports["catchAndRethrowErrorThatEscapesScope"] =
429 Function::New(env, CatchAndRethrowErrorThatEscapesScope);
430 exports["throwFatalError"] = Function::New(env, ThrowFatalError);
431 exports["throwDefaultError"] = Function::New(env, ThrowDefaultError);
432 exports["resetPromises"] = Function::New(env, ResetPromises);
433 exports["waitForWorkerThread"] = Function::New(env, WaitForWorkerThread);
434 exports["releaseWorkerThread"] = Function::New(env, ReleaseWorkerThread);
435 return exports;
436}

Callers 2

InitFunction · 0.85
InitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected