Example #1
0
static napi_value testStrictEquals(napi_env env, napi_callback_info info) {
  size_t argc = 2;
  napi_value args[2];
  NAPI_CALL(env, napi_get_cb_info(env, info, &argc, args, NULL, NULL));

  bool bool_result;
  napi_value result;
  NAPI_CALL(env, napi_strict_equals(env, args[0], args[1], &bool_result));
  NAPI_CALL(env, napi_get_boolean(env, bool_result, &result));

  return result;
}
napi_value StrictEquals(napi_env env, napi_callback_info info) {
  size_t argc = 2;
  napi_value argv[2];
  napi_value thisArg;
  void* data;
  NAPI_CALL(env, napi_get_cb_info(env, info, &argc, argv, &thisArg, &data));

  bool result = false;
  NAPI_CALL(env, napi_strict_equals(env, argv[0], argv[1], &result));

  napi_value ret;
  NAPI_CALL(env, napi_get_boolean(env, result, &ret));

  return ret;
}