The delete operator should trigger TDZ

RESOLVED FIXED in mozilla36

Status

()

RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: shu, Assigned: shu)

Tracking

({dev-doc-complete})

unspecified
mozilla36
dev-doc-complete
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [DocArea=JS])

Attachments

(1 attachment)

Comment hidden (empty)
(Assignee)

Comment 1

5 years ago
I missed this completely.
Attachment #8497194 - Flags: review?(jwalden+bmo)
Comment on attachment 8497194 [details] [diff] [review]
Make the delete operator trigger TDZ.

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

::: js/src/jit-test/tests/basic/letTDZDelete.js
@@ +10,5 @@
> +
> +assertThrowsReferenceError(function () { delete x; let x; });
> +
> +// FIXME bug 611388
> +//assertThrowsReferenceError(function () { delete x; const x; });

Make this something like

function constIsLexical()
{
  try {
    (function() { parseInt(z); const z; })();
    return false;
  } catch (e) {
    return true;
  }
}

// FIXME do this unconditionally when bug 611388 is fixt
if (constIsLexical())
  assertThrowsReferenceError(function () { delete x; const x; });

so that this test complains vocally and *forces* itself to be updated when const is made lexical.
Attachment #8497194 - Flags: review?(jwalden+bmo) → review+
Keywords: dev-doc-needed
Whiteboard: [DocArea=JS]

Comment 4

4 years ago
https://hg.mozilla.org/mozilla-central/rev/da1b3063095c
Assignee: nobody → shu
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.