Re:Promisees – JavaScript Promises Visualization
by conical on Monday September 21, 2015 @12:37AM
(#10250402)
Does the phrase "syntactic sugar" have any meaning? Name a new language feature that "it is just syntactic sugar" can't be applied to.
[ Parent
| on HN ]
Re:Promisees – JavaScript Promises Visualization
by callahad on Monday September 21, 2015 @12:45AM
(#10250426)
Sure, ES6 WeakMap and WeakSet can't be implemented without native support in the runtime.
Or, for that matter, const. Though perhaps const is just syntatic sugar for not reassigning to the same darn name? ;)
Re:Promisees – JavaScript Promises Visualization
by conical on Monday September 21, 2015 @01:30AM
(#10250527)
Const is a pretty good example, the closest I can think to emulating it in es5 is something like:
Object.defineProperty(this, 'five', { enumerable: true, writable: false, value: 5, configurable: false });
If in global scope, 'five' will look like a const.
WeakMap and WeakSet have polyfills with minor caveats.
I guess you're defining language features as not "syntactic sugar" if they can't be absolutely 100% polyfilled.