forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We make the `napi_env` per-module once more because it no longer holds any state that needs to be shared among add-ons. We then add a Node.js-specific N-API which allows one to obtain the module whose exports were initialized at addon startup. Re: nodejs/node-addon-api#449 Re: nodejs/node-addon-api#482 Re: nodejs/node-addon-api#505
- Loading branch information
Gabriel Schulhof
committed
Jun 28, 2019
1 parent
3322686
commit 925097e
Showing
10 changed files
with
75 additions
and
95 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,15 @@ | ||
'use strict'; | ||
|
||
const common = require('../../common'); | ||
const test_general = require(`./build/${common.buildType}/test_general`); | ||
const addonPath = `./build/${common.buildType}/test_general`; | ||
const resolvedPath = require.resolve(addonPath); | ||
const test_general = require(addonPath); | ||
const test_general_module = require.cache[resolvedPath]; | ||
const assert = require('assert'); | ||
|
||
const [ major, minor, patch, release ] = test_general.testGetNodeVersion(); | ||
assert.strictEqual(process.version.split('-')[0], | ||
`v${major}.${minor}.${patch}`); | ||
assert.strictEqual(release, process.release.name); | ||
|
||
assert.strictEqual(test_general_module, test_general.testGetModule()); |
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