Skip to content

Commit

Permalink
Merge pull request nodejs#149 from boingoing/fix_test_function
Browse files Browse the repository at this point in the history
napi: Fix test build break in test_function.cc
  • Loading branch information
boingoing authored Mar 16, 2017
2 parents e63b9ea + 0268c15 commit ad4c813
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
20 changes: 13 additions & 7 deletions test/addons-abi/test_error/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,36 @@ const myError = new MyError('Some MyError');
// Test that native error object is correctly classed
assert.strictEqual(test_error.checkError(theError), true,
'Error object correctly classed by napi_is_error');

// Test that native type error object is correctly classed
assert.strictEqual(test_error.checkError(theTypeError), true,
'Type error object correctly classed by napi_is_error');

// Test that native syntax error object is correctly classed
assert.strictEqual(test_error.checkError(theSyntaxError), true,
'Syntax error object correctly classed by napi_is_error');

// Test that native range error object is correctly classed
assert.strictEqual(test_error.checkError(theRangeError), true,
'Range error object correctly classed by napi_is_error');


// Test that native reference error object is correctly classed
assert.strictEqual(test_error.checkError(theReferenceError), true,
'Reference error object correctly classed by' +
' napi_is_error');

// Test that native URI error object is correctly classed
assert.strictEqual(test_error.checkError(theURIError), true,
'URI error object correctly classed by napi_is_error');

// Test that native eval error object is correctly classed
assert.strictEqual(test_error.checkError(theEvalError), true,
'Eval error object correctly classed by napi_is_error');

// Test that class derived from native error is correctly classed
assert.strictEqual(test_error.checkError(myError), true,
'Class derived from native error correctly classed by napi_is_error');
'Class derived from native error correctly classed by' +
' napi_is_error');

// Test that non-error object is correctly classed
assert.strictEqual(test_error.checkError({}), false,
Expand Down
2 changes: 1 addition & 1 deletion test/addons-abi/test_function/test_function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ void Init(napi_env env, napi_value exports, napi_value module) {
if (status != napi_ok) return;

napi_value fn;
status = napi_create_function(env, Test, nullptr, nullptr, &fn);
status = napi_create_function(env, nullptr, Test, nullptr, &fn);
if (status != napi_ok) return;

status = napi_set_property(env, exports, name, fn);
Expand Down

0 comments on commit ad4c813

Please sign in to comment.