That's why my first hint was .del() as it is in Python and makes sense
since ever and it could have made perfect sense in JS too, also as alias
for .delete() while transitioning from ES3 legacy, ES5 quirk engines, and
ES.next

That being said, I was simply warning that tools might break so this is not
just a developer problem but a tooling problem too.

I would not change direction now about .delete() it's too late, shims are
out, and it makes sense for everything but IE8 (I don't care about IE8 on
mobile so I am selfishly OK with that :P)

So mine was a double warning plus some thoughts on possible different
directions the method name could have taken.

Cheers


On Tue, Dec 17, 2013 at 2:53 PM, Alex Kocharin <a...@kocharin.ru> wrote:

>
> Well, you said that it works in IE8, and I don't care enough to test it,
> so said about IE6 because it is the same legacy kind of thing. Doesn't
> matter.
>
> Legacy and broken tools is not a valid reason to avoid perfectly good
> method name, especially considering the fact that it is a valid ES5 syntax
> everyone should be supporting for years now.
>
> "delete" can't stay a "not a reserved word, but kinda not recommended"
> forever you know, it doesn't make any sense.
>
> It should be named "delete" precisely because keyword was named delete, to
> make all these operators/functions look alike. Naming it "remove" just
> creates a confusion for no good reason.
>
>
> 18.12.2013, 02:17, "Andrea Giammarchi" <andrea.giammar...@gmail.com>:
>
> IE6 ? ... I don't understand your argument. We are talking about IE8 and
> polyfills that work already plus this does not solve the main problem which
> is about tools not always compatible with ES6 and/or future proof and shim
> aware.
>
> If tools were OK you wuld just write wm.delete(obj); and the tool would
> wrap that for you instead of throwing as these might do today.
>
> Regards
>
>
> On Tue, Dec 17, 2013 at 1:52 PM, Alex Kocharin <a...@kocharin.ru> wrote:
>
>
> You can't run any ES6 script in a browser that don't support ES6, because
> they will throw syntax error at the first yield (unless you're using
> compiler like traceur, but it won't have a problem with getting .delete
> work either).
>
> If you use shims, that's fine, but you're not writing ES6, you're writing
> ES5+shims, and that's not ES6 because you can't use all the features it
> introduces. I believe ecmascript isn't versionless yet like html is, and
> that number means something.
>
> If you want to support IE6 without compiling, fine, you can write in
> ES3+shims using wm['delete'](object) syntax. I don't see it being an issue.
>
>
> 18.12.2013, 00:59, "Andrea Giammarchi" <andrea.giammar...@gmail.com>:
>
> sorry what ?
>
>
> https://github.com/WebReflection/es6-collections#es6-harmony-collections-fast-polyfill
> https://code.google.com/p/es-lab/source/browse/trunk/src/ses/WeakMap.js
> https://github.com/Benvie/ES6-Harmony-Collections-Shim
> https://github.com/paulmillr/es6-shim
> https://gist.github.com/Gozala/1269991
>
> regards
>
>
>
> On Tue, Dec 17, 2013 at 11:38 AM, Alex Kocharin <a...@kocharin.ru> wrote:
>
>
> ES6 scripts will not work in IE8. Period. What's the point of making it
> work with a bit more ES6 scripts since all of them will never be supported
> anyway?
>
> I would only welcome if that badly written or outdated software gets
> exposed this way.
>
>
> 17.12.2013, 22:59, "Andrea Giammarchi" <andrea.giammar...@gmail.com>:
>
> not shold but **does** work ;-)
>
> Although I agree that specific thing is very inconvenient in some case and
> minifiers knows this too.
>
> As example, google closure compiler fails with this script in two ways
>
> ```javascript
> var wm = new WeakMap;
> wm.delete(Object);
> ```
>
> Simple minification does the right, resulting in an IE8 safe script such`
> wm['delete'](Object)` thing but it throws a warning:
> ```
> JSC_INVALID_ES3_PROP_NAME: Keywords and reserved words are not allowed as
> unquoted property names in older versions of JavaScript. If you are
> targeting newer versions of JavaScript, set the appropriate language_in
> option. at line 2 character 3
> wm.delete(Object);
> ```
>
> While in advance mode and no special flags it just breaks resulting in:
>
> `(new WeakMap).a(Object);`
>
> YUI is not even able to minify that script ... in few words developers
> tools do not make the usage of these methods in ES6 collections easy to
> write and use for developers themselves so tey have to remember those
> square brackets ... pretty silly if you ask me ^_^
>
> ES6#del() or remove() would have been way easier solution ... choosing a
> reserved word was OKish, but was also asking for few extra gotchas/troubles
> nobody really needed/wanted.
>
> The good part is: nobody will care about IE8 anymore ... and pretty
> soon!!! Still tools should be smarter about this issue
>
> Best Regards
>
>
>
>
>
>
> On Tue, Dec 17, 2013 at 1:38 AM, David Bruant <bruan...@gmail.com> wrote:
>
> Le 17/12/2013 10:19, Shijun He a écrit :
>
> There are some methods using reserved word "delete", such as
> Map.prototype.delete, Set.prototype.delete... Though it is allowed since
> ES5, I think we'd better avoid it because it cause es6 shim solution fail
> on legacy browsers such as IE8.
>
> Note that there is a warning [1] (maybe arguably). Among other
> incompatibilities, "size" is a getter too.
>
> myMap.delete fails, but myMap['delete'] should work.
>
> David
>
> [1] https://github.com/paulmillr/es6-shim/blob/
> 4322eae20b6f8a7769fa1d89ac207ef8ee9e1ee4/es6-shim.js#L662
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
> ,
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to