DescriptionPPC: Handle the case when derived constructor is [[Call]]ed with 0 args.
Port cf53fed972896bf23c037ce7ac9f8e1512463c62
Original commit message:
ArgumentsAdaptorStub for derived constructor (the one that needs
new.target) works in this way:
- If the constructor is invoked via the Construct stub, we know that
actual arguments always include new.target. ``arguments`` object
however should not include a new.target, therefore we remove it.
We achieve this by decrementing the argument count.
- If the constructor is invoked as a call, we do not care for a correct
``arguments`` array since the constructor will immediately throw on
entrance.
The bug is that the call could actually pass 0 actual arguments, but I
decrement unconditionally :(. The fix is to detect this case and avoid
decrementing. ``arguments`` is bogus, but it is ok as constructor
throws.
Long-term we should just remove mucking about with arguments for
new.target and just get it from the stack.
R=dslomov@chromium.org, dstence@us.ibm.com, michael_dawson@ca.ibm.com
BUG=
Committed: https://crrev.com/c7e02041b0bcc5c492d8129f2a6dac848299ddc2
Cr-Commit-Position: refs/heads/master@{#28269}
Patch Set 1 #
Messages
Total messages: 7 (1 generated)
|