Ticket #235 (new defect)

Opened 1 year ago

Last modified 1 year ago

(Resolved) "eval" should not be able to change DontDelete-ness of a binding

Reported by: lth Assigned to: brendan
Type: defect Priority: trivial
Milestone: Component: Spec
Version: 4 Keywords:
Cc: lth, waldemar@google.com

Description

(Really Brendan's bee, not mine, but the atrocity should be fixed anyhow.)

This is legal in ES3:

var v
eval("function v() {}")
delete v

It is legal because the introduction of the function by eval replaces the DontDelete binding of v with one that is deletable.

From https://bugzilla.mozilla.org/show_bug.cgi?id=395868 we have the following:

"""Relevant sections of the spec are: 10.1.3 where it states: "... If the variable object already has a property with this name, replace its value and attributes", and 10.2.2 with "Variable instantiation is performed using the calling context's variable object and using empty property attributes"."""

Attachments

Change History

Changed 1 year ago by lth

  • summary changed from eval can't change DontDelete-ness of a binding to eval should not be able to change DontDelete-ness of a binding

Changed 1 year ago by brendan

Thanks for filing this. It's not just a bee in my bonnet, but yours too ;-).

See https://bugzilla.mozilla.org/show_bug.cgi?id=395868#c14 where Florian Loitsch reports that no browser implements what ES1-3 specify here. That makes this a clear "bug fix" in the "de-facto standard trumps de-jure standard" sense, never mind the problems this poses for ES4.

/be

Changed 1 year ago by lth

I agree this seems like a clear bug fix candidate.

Changed 1 year ago by brendan

  • cc changed from brendan to lth, waldemar@google.com
  • owner changed from lth to brendan

Changed 1 year ago by lth

  • summary changed from eval should not be able to change DontDelete-ness of a binding to (Resolved) "eval" should not be able to change DontDelete-ness of a binding

Changed 1 year ago by lth

  • priority changed from major to trivial
Note: See TracTickets for help on using tickets.