MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / testShouldThrowErrorIfKeyIsInvalid

Function testShouldThrowErrorIfKeyIsInvalid

test/object/has_own_property.js:19–23  ·  view source on GitHub ↗
(nativeHasOwnProperty)

Source from the content-addressed store, hash-verified

17 }
18
19 function testShouldThrowErrorIfKeyIsInvalid (nativeHasOwnProperty) {
20 assert.throws(() => {
21 nativeHasOwnProperty(undefined, 'test');
22 }, /Cannot convert undefined or null to object/);
23 }
24
25 testHasOwnProperty(binding.object.hasOwnPropertyWithNapiValue);
26 testHasOwnProperty(binding.object.hasOwnPropertyWithNapiWrapperValue);

Callers 1

testFunction · 0.70

Calls

no outgoing calls

Tested by 1

testFunction · 0.56