n-api: implement napi_run_script#15216
Conversation
doc/api/n-api.md
Outdated
There was a problem hiding this comment.
Make it clear that this is in UTF-8? Or just take a string napi_value instead?
There was a problem hiding this comment.
Maybe it'd be easier to take a napi_value instead.
doc/api/n-api.md
Outdated
There was a problem hiding this comment.
… encoded as UTF-8 and null-terminated?
There was a problem hiding this comment.
don’t we technically need to free() this?
There was a problem hiding this comment.
Pointer star goes with the type.
There was a problem hiding this comment.
We’re inconsistent about that in this file, and I think this can pass as “idiomatic for C code”
doc/api/n-api.md
Outdated
679ade8 to
402d5be
Compare
|
Switched script parameter to |
07920bb to
c7d03d4
Compare
TimothyGu
left a comment
There was a problem hiding this comment.
In the future we might want to have an equivalent for V8's Script or UnboundScript, but this LGTM and should suffice for now.
doc/api/n-api.md
Outdated
There was a problem hiding this comment.
Please avoid the use of you in the docs.
N-API allows the execution of a JavaScript string using the underlying JavaScript engine.
c7d03d4 to
ca0d064
Compare
|
@jasnell I have reworded the sentence. |
|
SmartOS re-run: https://ci.nodejs.org/job/node-test-commit-smartos/11353/ |
Fixes: nodejs/abi-stable-node#51 PR-URL: nodejs#15216 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
|
Landed in 61e9ba1. |
Fixes: nodejs/abi-stable-node#51 PR-URL: #15216 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Fixes: nodejs/abi-stable-node#51 PR-URL: #15216 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Fixes: nodejs/abi-stable-node#51 PR-URL: #15216 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Fixes: nodejs/abi-stable-node#51 PR-URL: nodejs#15216 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
|
@gabrielschulhof sorry, missed reviewing this PR. @MSLaguana and I were looking at it for implementation in node-chakracore and we had a question- if someone was debugging their script and a script executed from this API was on the stack- what is the "filename" they expect to see? Dynamic code or something equivalent? Should there be a way of modules identifying themselves to the debugger? Or should these frames be considered "library code" and hidden from the debugger? |
|
@digitalinfinity maybe we should treat it like an eval. Chrome developer
tools opens a new tab and calls it "VM<number>" where number is probably
some internal counter or something like that. It paints the tab a different
colour.
In fact, I ran `node --inspect-brk
test/addons-napi/test_general/testNapiRun.js` and when I stepped into
`addon.testNapiRun()` it behaved exactly like `eval()`.
…On Fri, Sep 15, 2017 at 2:49 AM, Hitesh Kanwathirtha < ***@***.***> wrote:
@gabrielschulhof <https://github.com/gabrielschulhof> sorry, missed
reviewing this PR. @MSLaguana <https://github.com/mslaguana> and I were
looking at it for implementation in node-chakracore and we had a question-
if someone was debugging their script and a script executed from this API
was on the stack- what is the "filename" they expect to see? Dynamic code
or something equivalent? Should there be a way of modules identifying
themselves to the debugger? Or should these frames be considered "library
code" and hidden from the debugger?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#15216 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AA7k0etVgsKC-XXzJmDMQLQoyJOln7O1ks5sibt6gaJpZM4POMQh>
.
|
Fixes: nodejs/abi-stable-node#51 PR-URL: nodejs#15216 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Fixes: nodejs/abi-stable-node#51 Backport-PR-URL: #19447 PR-URL: #15216 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com Reviewed-By: James M Snell <jasnell.gmail.com> Reviewed-By: Michael Dawson <mhdawson@ca.ibm.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216 PR-URL: #616 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Kevin Eady <kevin.c.eady@gmail.com> Reviewed-By: Kevin Eady <kevin.c.eady@gmail.com>
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216 PR-URL: #616 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Kevin Eady <kevin.c.eady@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216 PR-URL: nodejs/node-addon-api#616 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Kevin Eady <kevin.c.eady@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216 PR-URL: nodejs/node-addon-api#616 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Kevin Eady <kevin.c.eady@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216 PR-URL: nodejs/node-addon-api#616 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Kevin Eady <kevin.c.eady@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This is a thin wrapper around napi_run_script. Refs: nodejs/node#15216 PR-URL: nodejs/node-addon-api#616 Reviewed-By: Nicola Del Gobbo <nicoladelgobbo@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Kevin Eady <kevin.c.eady@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Fixes: nodejs/abi-stable-node#51
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
n-api