-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make createDynamicFunction use NewTarget.prototype for Function parent
Summary: The old code was wrong in two ways: it was conditioned on this, not NewTarget, and used getParent, not prototype property. The fix is not obvious, because we need to avoid getting the prototype property twice. We condition on NewTarget, but instead of getting the prototype property, get the parent of 'this', which has already had its parent installed with the correct object. 'this' itself continues to be otherwise ignored, as the Function ctor does not formally reference it. Reviewed By: avp Differential Revision: D23834088 fbshipit-source-id: 057ce6f7a1b71220228a88a8160b82ba93c40baf
- Loading branch information
1 parent
2f07b10
commit addd6b8
Showing
2 changed files
with
35 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters