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

Conversation

@kfarnung
Copy link
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
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
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
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

@kfarnung
Copy link
Contributor Author

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.

PR-URL: nodejs#490
Reviewed-By: Taylor Woll <tawoll@ntdev.microsoft.com>
Reviewed-By: Jimmy Thomson <jithomso@microsoft.com>
@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 <tawoll@ntdev.microsoft.com>
Reviewed-By: Jimmy Thomson <jithomso@microsoft.com>
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