IsValidSimpleAssignmentTarget equivalent for delete?
Le 29 juil. 2015 à 19:28, Alan Schmitt <alan.schmitt at inria.fr> a écrit :
Hello,
ES6 introduces IsValidSimpleAssignmentTarget to make an early error the attempt to assign to something that is obviously not a reference. For instance
#+begin_src javascript ((function () { throw 42 })()) = 3; #+end_src
is now a syntax error.
Is there a reason why the same does not apply to the delete operator, such as in the following ?
#+begin_src javascript delete ((function () { throw 42 })()) #+end_src
Thanks,
Alan
The delete operator applied to a non-reference just does nothing (no error is thrown), whereas an assignment to a non-reference did throw an error.
I guess that there is some BC risk for trying to turn a non-error into an early error, not worth the advantage?
On 2015-07-31 06:26, Claude Pache <claude.pache at gmail.com> writes:
The
deleteoperator applied to a non-reference just does nothing (no error is thrown), whereas an assignment to a non-reference did throw an error. I guess that there is some BC risk for trying to turn a non-error into an early error, not worth the advantage?
It makes sense. Thank you for the reply.
Alan
Hello,
ES6 introduces IsValidSimpleAssignmentTarget to make an early error the attempt to assign to something that is obviously not a reference. For instance
#+begin_src javascript ((function () { throw 42 })()) = 3; #+end_src
is now a syntax error.
Is there a reason why the same does not apply to the delete operator, such as in the following ?
#+begin_src javascript delete ((function () { throw 42 })()) #+end_src
Thanks,
Alan
Hello, ES6 introduces IsValidSimpleAssignmentTarget to make an early error the attempt to assign to something that is obviously not a reference. For instance #+begin_src javascript ((function () { throw 42 })()) = 3; #+end_src is now a syntax error. Is there a reason why the same does not apply to the delete operator, such as in the following ? #+begin_src javascript delete ((function () { throw 42 })()) #+end_src Thanks, Alan -- OpenPGP Key ID : 040D0A3B4ED2E5C7 Last week athmospheric CO₂ average (Updated July 26, 2015, Mauna Loa Obs.): 401.25 ppm -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 472 bytes Desc: not available URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150729/8f1b0f1f/attachment.sig>