xref: /third_party/node/test/addons/report-fatalerror/binding.cc
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/addons/report-fatalerror/
11cb0ef41Sopenharmony_ci#include <node.h>
21cb0ef41Sopenharmony_ci#include <v8.h>
31cb0ef41Sopenharmony_ci
41cb0ef41Sopenharmony_ciusing v8::FunctionCallbackInfo;
51cb0ef41Sopenharmony_ciusing v8::Local;
61cb0ef41Sopenharmony_ciusing v8::MaybeLocal;
71cb0ef41Sopenharmony_ciusing v8::Object;
81cb0ef41Sopenharmony_ciusing v8::Value;
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_civoid TriggerFatalError(const FunctionCallbackInfo<Value>& args) {
111cb0ef41Sopenharmony_ci  // Trigger a v8 ApiCheck failure.
121cb0ef41Sopenharmony_ci  MaybeLocal<Value> value;
131cb0ef41Sopenharmony_ci  value.ToLocalChecked();
141cb0ef41Sopenharmony_ci}
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_civoid init(Local<Object> exports) {
171cb0ef41Sopenharmony_ci  NODE_SET_METHOD(exports, "triggerFatalError", TriggerFatalError);
181cb0ef41Sopenharmony_ci}
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_ciNODE_MODULE(NODE_GYP_MODULE_NAME, init)
21

Indexes created Thu Nov 07 10:32:03 CST 2024