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 <[email protected]> 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" <[email protected]>: > > 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 <[email protected]> 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" <[email protected]>: > > 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 <[email protected]> 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 > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > > , > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

