Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
n-api,test: fixing test breaks for chakracore
Browse files Browse the repository at this point in the history
* n-api: added implementation for new number APIs
* test-inspector: added specific message
  • Loading branch information
Jack Horton authored and boingoing committed Aug 18, 2017
1 parent b060614 commit bc4b141
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
28 changes: 27 additions & 1 deletion src/node_api_jsrt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1122,14 +1122,40 @@ napi_status napi_create_string_utf16(napi_env env,
return napi_ok;
}

napi_status napi_create_number(napi_env env,
napi_status napi_create_double(napi_env env,
double value,
napi_value* result) {
CHECK_ARG(result);
CHECK_JSRT(JsDoubleToNumber(value, reinterpret_cast<JsValueRef*>(result)));
return napi_ok;
}

napi_status napi_create_int32(napi_env env,
int32_t value,
napi_value* result) {
CHECK_ARG(result);
CHECK_JSRT(JsIntToNumber(value, reinterpret_cast<JsValueRef*>(result)));
return napi_ok;
}

napi_status napi_create_uint32(napi_env env,
uint32_t value,
napi_value* result) {
CHECK_ARG(result);
CHECK_JSRT(JsDoubleToNumber(static_cast<double>(value),
reinterpret_cast<JsValueRef*>(result)));
return napi_ok;
}

napi_status napi_create_int64(napi_env env,
int64_t value,
napi_value* result) {
CHECK_ARG(result);
CHECK_JSRT(JsDoubleToNumber(static_cast<double>(value),
reinterpret_cast<JsValueRef*>(result)));
return napi_ok;
}

napi_status napi_get_boolean(napi_env env, bool value, napi_value* result) {
CHECK_ARG(result);
CHECK_JSRT(JsBoolToBoolean(value, reinterpret_cast<JsValueRef*>(result)));
Expand Down
5 changes: 4 additions & 1 deletion test/inspector/test-inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,10 @@ function testCommandLineAPI(session) {
checkException(message);
assert.deepStrictEqual(JSON.parse(message['result']['value']), {
parentsEqual: true,
parentId: '<inspector console>'
parentId: common.engineSpecificMessage({
v8: '<inspector console>',
chakracore: '.'
})
});
}
],
Expand Down

0 comments on commit bc4b141

Please sign in to comment.