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 ?regardsOn 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 issueBest 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 :Note that there is a warning [1] (maybe arguably). Among other incompatibilities, "size" is a getter too.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.
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

