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

Commit 37d92c9

Browse files
committed
chakrashim: fix build break from JsCopyString
1 parent 0fa38ec commit 37d92c9

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

deps/chakrashim/src/jsrtutils.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -980,7 +980,7 @@ JsErrorCode StringUtf8::LengthFrom(JsValueRef strRef) {
980980
CHAKRA_ASSERT(_length == 0);
981981

982982
size_t len = 0;
983-
IfJsErrorRet(JsCopyString(strRef, nullptr, 0, &len));
983+
IfJsErrorRet(JsCopyString(strRef, nullptr, 0, nullptr, &len));
984984

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

998998
size_t written = 0;
999-
IfJsErrorRet(JsCopyString(strRef, buffer, len, &written));
999+
IfJsErrorRet(JsCopyString(strRef, buffer, len, &written, nullptr));
10001000

10011001
CHAKRA_ASSERT(len == written);
10021002
buffer[len] = '\0';

deps/chakrashim/src/v8string.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ String::Utf8Value::Utf8Value(Handle<v8::Value> obj)
3030
}
3131

3232
size_t len = 0;
33-
CHAKRA_VERIFY(JsCopyString(*str, nullptr, 0, &len) == JsNoError);
33+
CHAKRA_VERIFY(JsCopyString(*str, nullptr, 0, nullptr, &len) == JsNoError);
3434
char* buffer = reinterpret_cast<char*>(malloc(len + 1));
3535
CHAKRA_VERIFY(buffer != nullptr);
3636
size_t written = 0;
37-
if (JsCopyString(*str, buffer, len, &written) == JsNoError) {
37+
if (JsCopyString(*str, buffer, len, &written, nullptr) == JsNoError) {
3838
CHAKRA_ASSERT(len == written);
3939
buffer[len] = '\0';
4040
_str = buffer;
@@ -121,7 +121,7 @@ int String::WriteUtf8(
121121

122122
size_t count = 0;
123123
if (JsCopyString((JsValueRef)this,
124-
buffer, length, &count) == JsNoError) {
124+
buffer, length, &count, nullptr) == JsNoError) {
125125
if (count < (unsigned)length && !(options & String::NO_NULL_TERMINATION)) {
126126
// Utf8 version count includes null terminator
127127
buffer[count++] = 0;

src/node_api_jsrt.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ inline napi_status JsPropertyIdFromKey(JsValueRef key,
249249
if (keyType == JsString) {
250250
size_t length;
251251
CHECK_JSRT_EXPECTED(
252-
JsCopyString(key, nullptr, 0, &length), napi_string_expected);
252+
JsCopyString(key, nullptr, 0, nullptr, &length), napi_string_expected);
253253

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

259259
CHECK_JSRT(JsCreatePropertyId(
260260
reinterpret_cast<char*>(name.data()), length, propertyId));
@@ -1387,14 +1387,14 @@ napi_status napi_get_value_string_latin1(napi_env env,
13871387
if (!buf) {
13881388
CHECK_ARG(result);
13891389

1390-
JsErrorCode err = JsCopyString(js_value, nullptr, 0, result);
1390+
JsErrorCode err = JsCopyString(js_value, nullptr, 0, nullptr, result);
13911391
if (err != JsErrorInvalidArgument) {
13921392
return napi_set_last_error(err);
13931393
}
13941394
} else {
13951395
size_t copied = 0;
13961396
CHECK_JSRT_EXPECTED(
1397-
JsCopyString(js_value, buf, bufsize - 1, &copied),
1397+
JsCopyString(js_value, buf, bufsize - 1, &copied, nullptr),
13981398
napi_string_expected);
13991399

14001400
if (copied < bufsize - 1) {
@@ -1430,14 +1430,14 @@ napi_status napi_get_value_string_utf8(napi_env env,
14301430
if (!buf) {
14311431
CHECK_ARG(result);
14321432

1433-
JsErrorCode err = JsCopyString(js_value, nullptr, 0, result);
1433+
JsErrorCode err = JsCopyString(js_value, nullptr, 0, nullptr, result);
14341434
if (err != JsErrorInvalidArgument) {
14351435
return napi_set_last_error(err);
14361436
}
14371437
} else {
14381438
size_t copied = 0;
14391439
CHECK_JSRT_EXPECTED(
1440-
JsCopyString(js_value, buf, bufsize - 1, &copied),
1440+
JsCopyString(js_value, buf, bufsize - 1, &copied, nullptr),
14411441
napi_string_expected);
14421442

14431443
if (copied < bufsize - 1) {

0 commit comments

Comments
 (0)