Closed Bug 1456765 Opened 2 years ago Closed 2 years ago

[BinAST] Properly set metadata to compute Function.prototype.length

Categories

(Core :: JavaScript Engine, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: efaust, Assigned: efaust)

Details

Attachments

(1 file)

Attached patch FixSplinter Review
No description provided.
Attachment #8970819 - Flags: review?(dteller)
Comment on attachment 8970819 [details] [diff] [review]
Fix

Review of attachment 8970819 [details] [diff] [review]:
-----------------------------------------------------------------

::: js/src/frontend/BinSource.yaml
@@ +843,3 @@
>                  BINJS_TRY(parseContext_->positionalFormalParameterNames().append(result->pn_atom));
> +                if (parseContext_->isFunctionBox())
> +                    parseContext_->functionBox()->length++;

Doesn't this duplicate the

`
funbox->function()->setArgCount(params ? uint16_t(params->pn_count) : 0);

`

in `buildFunction`?
Attachment #8970819 - Flags: review?(dteller) → feedback+
You wish. I think because of bound functions (and possibly also defaults?), there are two different numbers consulted.
Attachment #8970819 - Flags: feedback+ → review+
Priority: -- → P2
Pushed by efaustbmo@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/788d13487010
[BinAST] Properly compute Function.length. (r=Yoric)
https://hg.mozilla.org/mozilla-central/rev/788d13487010
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
You need to log in before you can comment on or make changes to this bug.