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

Function test

test/object/subscript_operator.js:7–17  ·  view source on GitHub ↗
(binding)

Source from the content-addressed store, hash-verified

5module.exports = require('../common').runTest(test);
6
7function test (binding) {
8 function testProperty (obj, key, value, nativeGetProperty, nativeSetProperty) {
9 nativeSetProperty(obj, key, value);
10 assert.strictEqual(nativeGetProperty(obj, key), value);
11 }
12
13 testProperty({}, 'key', 'value', binding.object.subscriptGetWithCStyleString, binding.object.subscriptSetWithCStyleString);
14 testProperty({ key: 'override me' }, 'key', 'value', binding.object.subscriptGetWithCppStyleString, binding.object.subscriptSetWithCppStyleString);
15 testProperty({}, 0, 'value', binding.object.subscriptGetAtIndex, binding.object.subscriptSetAtIndex);
16 testProperty({ key: 'override me' }, 0, 'value', binding.object.subscriptGetAtIndex, binding.object.subscriptSetAtIndex);
17}

Callers

nothing calls this directly

Calls 1

testPropertyFunction · 0.85

Tested by

no test coverage detected