-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
async_hooks: expose async_wrap providers
docs: add asyncWrapProviders api doc tests(async_hooks): use internalBinding for comparisson fix(test-async-wrap): lint error docs: use REPLACEME for asyncWrapProviders update: use freeze and copy for asyncWrapProviders update(async_hooks): use primordials on asyncWrapProviders fix: use common to expect error docs(asyncWrapProviders): rephrase return type fix: lint md fix: lint md docs(async_hooks): typo Co-authored-by: Stephen Belanger <[email protected]> update(asyncWrapProviders): add __proto__ as null Co-authored-by: Simone Busoli <[email protected]> Co-authored-by: Michaël Zasso <[email protected]> test: adjust __proto__ assertion docs: add DEP0111 link PR-URL: #40760 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Stephen Belanger <[email protected]>
- Loading branch information
1 parent
cebf403
commit 078a0c9
Showing
4 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Flags: --expose-internals | ||
'use strict'; | ||
|
||
const common = require('../common'); | ||
const { internalBinding } = require('internal/test/binding'); | ||
const providers = internalBinding('async_wrap').Providers; | ||
const assert = require('assert'); | ||
const { asyncWrapProviders } = require('async_hooks'); | ||
|
||
assert.ok(typeof asyncWrapProviders === 'object'); | ||
assert.deepStrictEqual(asyncWrapProviders, { __proto__: null, ...providers }); | ||
|
||
const providerKeys = Object.keys(asyncWrapProviders); | ||
assert.throws(() => { | ||
asyncWrapProviders[providerKeys[0]] = 'another value'; | ||
}, common.expectsError({ | ||
name: 'TypeError', | ||
}), 'should not allow modify asyncWrap providers'); |