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

Function testShouldThrowErrorIfKeyIsInvalid

test/object/get_property.js:18–22  ·  view source on GitHub ↗
(nativeGetProperty)

Source from the content-addressed store, hash-verified

16 }
17
18 function testShouldThrowErrorIfKeyIsInvalid (nativeGetProperty) {
19 assert.throws(() => {
20 nativeGetProperty(undefined, 'test');
21 }, /Cannot convert undefined or null to object/);
22 }
23
24 const testObject = { 42: 100 };
25 const property = binding.object.getPropertyWithUint32(testObject, 42);

Callers 1

testFunction · 0.70

Calls

no outgoing calls

Tested by 1

testFunction · 0.56