mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 21:58:48 +02:00
n-api: make func argument of napi_create_threadsafe_function optional
PR-URL: https://github.com/nodejs/node/pull/27791 Refs: https://github.com/nodejs/node/issues/27592 Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
This commit is contained in:
parent
ab3174ca08
commit
5705d7bf60
4 changed files with 68 additions and 11 deletions
|
@ -102,6 +102,17 @@ new Promise(function testWithoutJSMarshaller(resolve) {
|
|||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
// Start the thread in blocking mode, and assert that all values are passed.
|
||||
// Quit after it's done.
|
||||
// Doesn't pass the callback js function to napi_create_threadsafe_function.
|
||||
// Instead, use an alternative reference to get js function called.
|
||||
.then(() => testWithJSMarshaller({
|
||||
threadStarter: 'StartThreadNoJsFunc',
|
||||
maxQueueSize: binding.MAX_QUEUE_SIZE,
|
||||
quitAfter: binding.ARRAY_LENGTH
|
||||
}))
|
||||
.then((result) => assert.deepStrictEqual(result, expectedArray))
|
||||
|
||||
// Start the thread in blocking mode with an infinite queue, and assert that all
|
||||
// values are passed. Quit after it's done.
|
||||
.then(() => testWithJSMarshaller({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue