Closed Bug 1481248 Opened 6 years ago Closed 6 years ago

yield* should not use JSOP_EQ to check the presence of the "throw" property

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

Using JSOP_EQ means [[IsHTMLDDA]] objects are incorrectly handled.
Attached patch bug1481248.patchSplinter Review
Updated emitYieldStar() to use emitPushNotUndefinedOrNull() to ensure we use strict-equals checks against |undefined| and |null|. Also switched the consequent and alternative blocks for ifThrowMethodIsNotDefined to better match the spec text.

Drive-by changes:
- Updated the remaining if-statement to compare against |IteratorKind::Async| similar to the existing if-statement at [1].
- Updated one stack-depth update into an assertion, because it seems like the stack-depth is always correct after calling |tryCatch.emitCatch()|.

[1] https://searchfox.org/mozilla-central/rev/3fdc491e118c5cdfbaf6e2d52f3466d2b27ad1de/js/src/frontend/BytecodeEmitter.cpp#6232
Attachment #8997975 - Flags: review?(arai.unmht)
Comment on attachment 8997975 [details] [diff] [review]
bug1481248.patch

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

Thanks!
Attachment #8997975 - Flags: review?(arai.unmht) → review+
Pushed by btara@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/df05fdfe1af8
Use strict instead of sloppy equals for 'throw' method check in yield*. r=arai
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/df05fdfe1af8
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: