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

Commit

Permalink
chakrashim: fix build break from JsCopyString
Browse files Browse the repository at this point in the history
  • Loading branch information
kunalspathak committed Jul 28, 2017
1 parent 0fa38ec commit 37d92c9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions deps/chakrashim/src/jsrtutils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ JsErrorCode StringUtf8::LengthFrom(JsValueRef strRef) {
CHAKRA_ASSERT(_length == 0);

size_t len = 0;
IfJsErrorRet(JsCopyString(strRef, nullptr, 0, &len));
IfJsErrorRet(JsCopyString(strRef, nullptr, 0, nullptr, &len));

_length = len;
return JsNoError;
Expand All @@ -996,7 +996,7 @@ JsErrorCode StringUtf8::From(JsValueRef strRef) {
CHAKRA_VERIFY(buffer != nullptr);

size_t written = 0;
IfJsErrorRet(JsCopyString(strRef, buffer, len, &written));
IfJsErrorRet(JsCopyString(strRef, buffer, len, &written, nullptr));

CHAKRA_ASSERT(len == written);
buffer[len] = '\0';
Expand Down
6 changes: 3 additions & 3 deletions deps/chakrashim/src/v8string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ String::Utf8Value::Utf8Value(Handle<v8::Value> obj)
}

size_t len = 0;
CHAKRA_VERIFY(JsCopyString(*str, nullptr, 0, &len) == JsNoError);
CHAKRA_VERIFY(JsCopyString(*str, nullptr, 0, nullptr, &len) == JsNoError);
char* buffer = reinterpret_cast<char*>(malloc(len + 1));
CHAKRA_VERIFY(buffer != nullptr);
size_t written = 0;
if (JsCopyString(*str, buffer, len, &written) == JsNoError) {
if (JsCopyString(*str, buffer, len, &written, nullptr) == JsNoError) {
CHAKRA_ASSERT(len == written);
buffer[len] = '\0';
_str = buffer;
Expand Down Expand Up @@ -121,7 +121,7 @@ int String::WriteUtf8(

size_t count = 0;
if (JsCopyString((JsValueRef)this,
buffer, length, &count) == JsNoError) {
buffer, length, &count, nullptr) == JsNoError) {
if (count < (unsigned)length && !(options & String::NO_NULL_TERMINATION)) {
// Utf8 version count includes null terminator
buffer[count++] = 0;
Expand Down
12 changes: 6 additions & 6 deletions src/node_api_jsrt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,12 @@ inline napi_status JsPropertyIdFromKey(JsValueRef key,
if (keyType == JsString) {
size_t length;
CHECK_JSRT_EXPECTED(
JsCopyString(key, nullptr, 0, &length), napi_string_expected);
JsCopyString(key, nullptr, 0, nullptr, &length), napi_string_expected);

std::vector<uint8_t> name;
name.reserve(length + 1);
CHECK_JSRT(JsCopyString(
key, reinterpret_cast<char*>(name.data()), length + 1, &length));
key, reinterpret_cast<char*>(name.data()), length + 1, &length, nullptr));

CHECK_JSRT(JsCreatePropertyId(
reinterpret_cast<char*>(name.data()), length, propertyId));
Expand Down Expand Up @@ -1387,14 +1387,14 @@ napi_status napi_get_value_string_latin1(napi_env env,
if (!buf) {
CHECK_ARG(result);

JsErrorCode err = JsCopyString(js_value, nullptr, 0, result);
JsErrorCode err = JsCopyString(js_value, nullptr, 0, nullptr, result);
if (err != JsErrorInvalidArgument) {
return napi_set_last_error(err);
}
} else {
size_t copied = 0;
CHECK_JSRT_EXPECTED(
JsCopyString(js_value, buf, bufsize - 1, &copied),
JsCopyString(js_value, buf, bufsize - 1, &copied, nullptr),
napi_string_expected);

if (copied < bufsize - 1) {
Expand Down Expand Up @@ -1430,14 +1430,14 @@ napi_status napi_get_value_string_utf8(napi_env env,
if (!buf) {
CHECK_ARG(result);

JsErrorCode err = JsCopyString(js_value, nullptr, 0, result);
JsErrorCode err = JsCopyString(js_value, nullptr, 0, nullptr, result);
if (err != JsErrorInvalidArgument) {
return napi_set_last_error(err);
}
} else {
size_t copied = 0;
CHECK_JSRT_EXPECTED(
JsCopyString(js_value, buf, bufsize - 1, &copied),
JsCopyString(js_value, buf, bufsize - 1, &copied, nullptr),
napi_string_expected);

if (copied < bufsize - 1) {
Expand Down

0 comments on commit 37d92c9

Please sign in to comment.