<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Sep 17, 2015 at 4:17 PM, Chris Peterson <span dir="ltr"><<a href="mailto:cpeterson@mozilla.com" target="_blank">cpeterson@mozilla.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000"><span class="">
<br>
<br>
<div>On 9/17/15 11:59 AM, Shu-yu Guo wrote:<br>
</div>
<blockquote type="cite">
<div style="font-family:arial,helvetica,sans-serif">
Because until now, our global 'let' semantics have been
identical to those of 'var', I have already landed a patch that
mass replaces global 'let' with 'var' as part of bug 1202902.<br>
<br>
</div>
<div style="font-family:arial,helvetica,sans-serif">Because there is
no direct syntactic replacement for 'const', I am combing
through the code on a case by case basis.</div>
</blockquote>
<br></span>
Shu, can you mass replace `const X = Y` with `var /*const*/ X = Y`?
The const comment would be a hint to readers and a greppable string
we could try replacing with ES6 const later.<br></div></blockquote><div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I'm trying to see if I can just do spot fixes before resorting a mass replace. There are many many more uses of const than let.<br></div><br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
<br>
Or could you preserve the const property by expanding `const X = Y`
to something like `Object.defineProperty(this, 'X', {value:Y,
writable:false})`?<br></div></blockquote><div><br><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">This is harder to script (but my script-fu is weak), as a large percentage of const declarations are destructuring assignments.<br></div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div bgcolor="#FFFFFF" text="#000000">
</div>
<br>_______________________________________________<br>
firefox-dev mailing list<br>
<a href="mailto:firefox-dev@mozilla.org">firefox-dev@mozilla.org</a><br>
<a href="https://mail.mozilla.org/listinfo/firefox-dev" rel="noreferrer" target="_blank">https://mail.mozilla.org/listinfo/firefox-dev</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><font face="monospace"> shu</font><br></div></div></div></div>
</div></div>