Commit 32412a8d authored by Gabriel Schulhof's avatar Gabriel Schulhof Committed by Myles Borins
Browse files

n-api: make changes for source compatibility

These changes are necessary in order to retain source compatibility
with older versions of node.

The removal of `module_version` from `napi_module_register()` is
reverted from the flag removal PR, because it should not have been a
part of it.

`CallbackWrapper::NewTarget()` is renamed to
`CallbackWrapper::GetNewTarget()` to distinguish it from V8's native
method, thus allowing for a macro which reduces `NewTarget()` to
`This()` on V8 versions where it was not yet available.

`AsyncResource` is constructed with a C string rather than a V8 string
because the former is available on all versions of node.

Backport-PR-URL: https://github.com/nodejs/node/pull/19447
PR-URL: https://github.com/nodejs/node/pull/16102


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarJason Ginchereau <jasongin@microsoft.com>
parent 5bba809e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment