File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ inline bool Value::IsTypedArray() const {
329329}
330330
331331inline bool Value::IsObject () const {
332- return Type () == napi_object;
332+ return Type () == napi_object || IsFunction () ;
333333}
334334
335335inline bool Value::IsFunction () const {
Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ test(require(`../build/${buildType}/binding.node`));
77test ( require ( `../build/${ buildType } /binding_noexcept.node` ) ) ;
88
99function test ( binding ) {
10+ function isObject ( value ) {
11+ return typeof value === 'object' || typeof value === 'function' ;
12+ }
13+
1014 function detailedTypeOf ( value ) {
1115 const type = typeof value ;
1216 if ( type !== 'object' )
@@ -57,7 +61,7 @@ function test(binding) {
5761
5862 testValueList . forEach ( ( testValue ) => {
5963 if ( testValue !== null && expectedType === 'object' ) {
60- assert . strictEqual ( typeChecker ( testValue ) , typeof testValue === expectedType ) ;
64+ assert . strictEqual ( typeChecker ( testValue ) , isObject ( testValue ) ) ;
6165 } else {
6266 assert . strictEqual ( typeChecker ( testValue ) , detailedTypeOf ( testValue ) === expectedType ) ;
6367 }
You can’t perform that action at this time.
0 commit comments