Skip to content

Commit ad4c813

Browse files
authored
Merge pull request nodejs#149 from boingoing/fix_test_function
napi: Fix test build break in test_function.cc
2 parents e63b9ea + 0268c15 commit ad4c813

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

test/addons-abi/test_error/test.js

+13-7
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,36 @@ const myError = new MyError('Some MyError');
1717
// Test that native error object is correctly classed
1818
assert.strictEqual(test_error.checkError(theError), true,
1919
'Error object correctly classed by napi_is_error');
20-
20+
2121
// Test that native type error object is correctly classed
2222
assert.strictEqual(test_error.checkError(theTypeError), true,
2323
'Type error object correctly classed by napi_is_error');
24-
24+
2525
// Test that native syntax error object is correctly classed
2626
assert.strictEqual(test_error.checkError(theSyntaxError), true,
2727
'Syntax error object correctly classed by napi_is_error');
28-
28+
2929
// Test that native range error object is correctly classed
3030
assert.strictEqual(test_error.checkError(theRangeError), true,
3131
'Range error object correctly classed by napi_is_error');
32-
32+
33+
// Test that native reference error object is correctly classed
34+
assert.strictEqual(test_error.checkError(theReferenceError), true,
35+
'Reference error object correctly classed by' +
36+
' napi_is_error');
37+
3338
// Test that native URI error object is correctly classed
3439
assert.strictEqual(test_error.checkError(theURIError), true,
3540
'URI error object correctly classed by napi_is_error');
36-
41+
3742
// Test that native eval error object is correctly classed
3843
assert.strictEqual(test_error.checkError(theEvalError), true,
3944
'Eval error object correctly classed by napi_is_error');
40-
45+
4146
// Test that class derived from native error is correctly classed
4247
assert.strictEqual(test_error.checkError(myError), true,
43-
'Class derived from native error correctly classed by napi_is_error');
48+
'Class derived from native error correctly classed by' +
49+
' napi_is_error');
4450

4551
// Test that non-error object is correctly classed
4652
assert.strictEqual(test_error.checkError({}), false,

test/addons-abi/test_function/test_function.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ void Init(napi_env env, napi_value exports, napi_value module) {
4949
if (status != napi_ok) return;
5050

5151
napi_value fn;
52-
status = napi_create_function(env, Test, nullptr, nullptr, &fn);
52+
status = napi_create_function(env, nullptr, Test, nullptr, &fn);
5353
if (status != napi_ok) return;
5454

5555
status = napi_set_property(env, exports, name, fn);

0 commit comments

Comments
 (0)