Questions tagged [ecmascript-harmony]

ECMAScript Harmony is the code name for proposals aiming to extend the current ECMA-262 specification.

ECMAScript Harmony is the code name for proposals aiming to extend the current ECMA-262 specification and to form the new . It names the agreed design trajectory of post-ES5 editions. It will include syntactic extensions, but the changes will be more modest than ECMAScript 4 in both semantic and syntactic innovation.

Packages, namespaces, and early binding from ECMAScript 4 are no longer included for planned releases, and don't live under the roof of Harmony.

References

  1. ECMAScript - Wikipedia
  2. ECMAScriptHarmony - ECMAScript.org
239 questions
14
votes
1 answer

Javascript: Is there an equivalent to caniuse.com for HTML5 APIs/ECMAScript5/ECMAScript6 in the various browsers?

Is there an equivalent to caniuse.com for HTML5 APIs / ECMAScript5 / ECMAScript6 in the various browsers? caniuse.com does have some javascript coverage, but pages like http://caniuse.com/#feat=filesystem don't really tell you anything other than…
BrianFreud
  • 7,094
  • 6
  • 33
  • 50
13
votes
2 answers

How can I feature-detect ES6 generators?

I'm really enjoying ES6 generators. Is there a way I can detect generator support in browsers? I know generators might not be in a lot of browsers (or possible no browsers at all) at the moment, but that's OK for my purposes. I tried: try { …
13
votes
1 answer

What does ReturnIfAbrupt mean in ES6 draft?

I'm currently implementing some shims for the ES6 draft. I'm wondering if anyone can tell me what ReturnIfAbrupt means. For instance, my implementation for Number.toInt (which calls internal [[ToInteger]] is as follows: if (!('toInt' in Number)) …
Nathan Wall
  • 10,530
  • 4
  • 24
  • 47
13
votes
5 answers

Javascript optional type hinting

When a programming language is statically typed, the compiler can be more precise about memory allocation and thus be generally more performant (with all other things equal). I believe ES4 introduced optional type hinting (from what I understand,…
badunk
  • 4,310
  • 5
  • 27
  • 47
12
votes
3 answers

Ecmascript 6 support on Node.js

I've been working with KoaJS for a while, and we can easily use the 'let' keyword and the generators when using the --harmony flag but I couldn't find how much support for does the node v0.11.x provides while using the same. I tried using the…
I_Debug_Everything
  • 3,776
  • 4
  • 36
  • 48
12
votes
2 answers

ES6 Modules vs. HTML Imports

HTML Imports are a part of the Web Components specification and provide a way to handle dependencies on the Web. ES6 modules also do the same thing, but just for Javascript code. Is there is any clarity on how these two will work together? Edit: An…
Debjit
  • 326
  • 4
  • 13
11
votes
1 answer

ES2015 Destructure object twice in same scope

Is there a clean way to destructure the same variables from 2 similar objects in the same scope? function(oldState, newState) { let {foo, bar} = oldState; // do stuff // let {foo, bar} = newState; // illegal double declaration in same scope …
Matt K
  • 4,813
  • 4
  • 22
  • 35
11
votes
1 answer

Function parameter definitions in ES6

I'm sure that this is relatively straightforward and that I'm missing something obvious. I'm reading through Mozilla's tutorials on ES6, and their chapter on destructuring contains the following pattern: FUNCTION PARAMETER DEFINITIONS As…
fox
  • 15,428
  • 20
  • 55
  • 85
11
votes
2 answers

user defined object equality for a set in harmony (es6)

I have a problem where I'm generating many values and need to make sure I only work with unique ones. Since I'm using node js, with the --harmony flag, and have access to harmony collections, I decided that a Set may be an option. What I'm looking…
Mike McFarland
  • 657
  • 4
  • 17
11
votes
2 answers

Does Mocha ignore --harmony option in mocha.opts?

In my test directory, I have a file mocha.opts containing the following: --harmony --recursive --growl --reporter spec --require should When I run mocha, I get the following error: /project/server/utilities/encryption.js:3 const ^^^^^ SyntaxError:…
11
votes
2 answers

Getting a promise's value via yield & co

I'm trying to figure out how to get the value of a promise via yield, possibly with "co": function *(){ var someVar = yield functionThatReturnsAPromise(); } The called function is not a generator, just a normal function. With the above,…
user578895
11
votes
1 answer

ES6 Module export default syntax

I'm using the es6-module-transpiler, esprima and JSHint with esnext: true options. JSHint complains when I put: export default = { some: 'thing', other: 'thing' }; But esprima complains when I use export default { some: 'thing', other: 'thing'…
Jacob
  • 3,629
  • 3
  • 36
  • 44
10
votes
1 answer

Is it possible to use Harmony (ES6) with JSXTransformer.js?

I've had great luck using React's JSXTransformer.js to develop using JSX in the browser: To reduce boilerplate, I'd like to…
danvk
  • 15,863
  • 5
  • 72
  • 116
10
votes
2 answers

Getting ES6 features with node and nvm

I already had node 0.10.* and I installed nvm, then through nvm I installed 0.11.13 and 0.10 again. node --version gives back 0.11.13 I try to use some of the ES6 features I read about and nothing I tried works. I run my script with node --harmony…
Madd0g
  • 3,841
  • 5
  • 37
  • 59
10
votes
2 answers

*something* if *expression* syntax in JavaScript (FF)

I have seen some examples that show that Firefox supports some kind of JavaScript syntax along the lines of *something* if *expression*;. As an example of what I'm talking about, see this MDN article, which contains the following example: var evens…
Nathan Wall
  • 10,530
  • 4
  • 24
  • 47