Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
squash: address comments
  • Loading branch information
mhdawson committed Sep 26, 2017
commit d319160c7581a19fae7b251b6f30734f9fef39c3
4 changes: 2 additions & 2 deletions src/node_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ struct napi_env__ {
"Casting NAPI_AUTO_LENGTH to int must result in -1"); \
RETURN_STATUS_IF_FALSE((env), \
(len == NAPI_AUTO_LENGTH) || len <= INT_MAX, \
napi_generic_failure); \
napi_invalid_arg); \
auto str_maybe = v8::String::NewFromUtf8( \
(env)->isolate, (str), v8::NewStringType::kInternalized, \
static_cast<int>(len)); \
Expand Down Expand Up @@ -870,7 +870,7 @@ void napi_module_register(napi_module* mod) {

// Warning: Keep in-sync with napi_status enum
const char* error_messages[] = {nullptr,
"Invalid pointer passed as argument",
"Invalid argument",
"An object was expected",
"A string was expected",
"A string or symbol was expected",
Expand Down
4 changes: 2 additions & 2 deletions test/addons-napi/test_string/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ assert.strictEqual(test_string.Utf16Length(str6), 5);
assert.strictEqual(test_string.Utf8Length(str6), 14);

assert.throws(() => {
test_string.TestLargeUtf8()
}, /^Error: Unknown failure$/);
test_string.TestLargeUtf8();
}, /^Error: Invalid argument$/);