Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

src: update napi_get_new_target to match docs#490

Merged
kfarnung merged 1 commit intonodejs:masterfrom
kfarnung:napitest
Mar 8, 2018
Merged

src: update napi_get_new_target to match docs#490
kfarnung merged 1 commit intonodejs:masterfrom
kfarnung:napitest

Conversation

@kfarnung
Copy link
Copy Markdown
Contributor

@kfarnung kfarnung commented Mar 8, 2018

The implementation for napi_get_new_target needs to return nullptr
when the function is not being called as a constructor.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

@kfarnung kfarnung requested a review from boingoing March 8, 2018 04:36
bool result;
napi_value newTargetArg;
NAPI_CALL(env, napi_get_new_target(env, info, &newTargetArg));
napi_value undefined;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this test change from upstream?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't exist upstream, @boingoing added it to node-chakracore. I'm planning to upstream the test as well. I found the issue when trying to build and test the V8 version of our branch.

Copy link
Copy Markdown
Contributor

@boingoing boingoing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The implementation for `napi_get_new_target` needs to return nullptr
when the function is not being called as a constructor.

PR-URL: nodejs#490
Reviewed-By: Taylor Woll <[email protected]>
Reviewed-By: Jimmy Thomson <[email protected]>
@kfarnung kfarnung merged commit b27fa80 into nodejs:master Mar 8, 2018
@kfarnung kfarnung deleted the napitest branch March 8, 2018 18:17
kfarnung added a commit to kfarnung/node-chakracore that referenced this pull request Mar 8, 2018
The implementation for `napi_get_new_target` needs to return nullptr
when the function is not being called as a constructor.

PR-URL: nodejs#490
Reviewed-By: Taylor Woll <[email protected]>
Reviewed-By: Jimmy Thomson <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants