db7c92fd57
* test: drop the now-empty remote runner from CI * move fixtures to spec-main * remove remote runner * fix stuff * remove global-paths hack * move ts-smoke to spec/ * fix test after merge * rename spec-main to spec * no need to ignore spec/node_modules twice * simplify spec-runner a little * no need to hash pj/yl twice * undo lint change to verify-mksnapshot.py * excessive .. * update electron_woa_testing.yml * don't search for test-results-remote.xml it is never produced now
38 lines
869 B
C++
38 lines
869 B
C++
#include <js_native_api.h>
|
|
#include <node_api.h>
|
|
|
|
namespace {
|
|
|
|
napi_value Print(napi_env env, napi_callback_info info) {
|
|
size_t argc = 1;
|
|
napi_value args[1];
|
|
napi_status status;
|
|
|
|
status = napi_get_cb_info(env, info, &argc, args, NULL, NULL);
|
|
if (status != napi_ok)
|
|
return NULL;
|
|
|
|
if (argc > 1) {
|
|
napi_throw_error(env, NULL,
|
|
"Wrong number of arguments, expected single argument");
|
|
}
|
|
|
|
return args[0];
|
|
}
|
|
|
|
napi_value Init(napi_env env, napi_value exports) {
|
|
napi_status status;
|
|
napi_property_descriptor descriptors[] = {
|
|
{"Print", NULL, Print, NULL, NULL, NULL, napi_default, NULL}};
|
|
|
|
status = napi_define_properties(
|
|
env, exports, sizeof(descriptors) / sizeof(*descriptors), descriptors);
|
|
if (status != napi_ok)
|
|
return NULL;
|
|
|
|
return exports;
|
|
}
|
|
|
|
} // namespace
|
|
|
|
NAPI_MODULE(NODE_GYP_MODULE_NAME, Init)
|