Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify util.types.isExternal #20604

Closed
jdalton opened this issue May 8, 2018 · 4 comments
Closed

Clarify util.types.isExternal #20604

jdalton opened this issue May 8, 2018 · 4 comments
Labels
question Issues that look for answers.

Comments

@jdalton
Copy link
Member

jdalton commented May 8, 2018

It doesn't look like there are any unit tests for util.types.isExternal.

I was hoping the docs had a usage example but couldn't find one.

Update:

Found a unit test:

const { JSStream } = process.binding('js_stream');
const external = (new JSStream())._externalStream;
@TimothyGu
Copy link
Member

We could put a piece of C++ code for creating a v8::External in as an example.

@cjihrig
Copy link
Contributor

cjihrig commented May 9, 2018

Another alternative would be napi_create_external(), as it's a little more VM neutral than the V8 API.

@Fishrock123 Fishrock123 added the question Issues that look for answers. label May 10, 2018
@apapirovski
Copy link
Member

Given the lack of movement here, I'm going to close this out but definitely feel free to reopen if you feel strongly about this. That said, a PR might be the best course of action at this point?

@jdalton jdalton reopened this Nov 29, 2018
@jdalton
Copy link
Member Author

jdalton commented Nov 29, 2018

The docs for isExternal could still be improved. It's still missing a usage example.

HarshithaKP added a commit to HarshithaKP/node that referenced this issue Jan 10, 2020
added usage example for util.types.isExternal
which was missing owing to the complexity.
Used a combination of n-api and js to demonstrate
usage of the api.

Fixes: nodejs#20604
MylesBorins pushed a commit that referenced this issue Jan 16, 2020
added usage example for util.types.isExternal
which was missing owing to the complexity.
Used a combination of n-api and js to demonstrate
usage of the api.

PR-URL: #31173
Fixes: #20604
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere pushed a commit that referenced this issue Mar 14, 2020
added usage example for util.types.isExternal
which was missing owing to the complexity.
Used a combination of n-api and js to demonstrate
usage of the api.

PR-URL: #31173
Fixes: #20604
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
codebytere pushed a commit that referenced this issue Mar 17, 2020
added usage example for util.types.isExternal
which was missing owing to the complexity.
Used a combination of n-api and js to demonstrate
usage of the api.

PR-URL: #31173
Fixes: #20604
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issues that look for answers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants