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
45
votes
1 answer

Is "use strict" necessary in ECMAScript 6?

I'm wondering when ECMAScript 6 comes, do we still need to put "use strict" in js codes?
nightire
  • 1,371
  • 2
  • 11
  • 21
45
votes
6 answers

Map using tuples or objects

I'm trying to use the new (ES6) Map objects in order to represent a map between properties and a value. I have objects in a form similar to: {key1:value1_1,key2:value2_1},..... {key1:value1_N,key2:value2_N} I want to group them based on both their…
Benjamin Gruenbaum
  • 270,886
  • 87
  • 504
  • 504
43
votes
8 answers

ECMAScript:Harmony / ES6 to JavaScript compiler

After reading Peter's article on JavaScript I noticed Brendan Eich stated that one the goals for Harmony is to be a better target for to-JavaScript compilers. There are currently two popular compilers with some vague ES:Harmony…
Raynos
  • 166,823
  • 56
  • 351
  • 396
40
votes
11 answers

Is it possible to reset an ECMAScript 6 generator to its initial state?

Given the provided (very simple) generator, is it possible to return the generator back to its original state to use again? var generator = function*() { yield 1; yield 2; yield 3; }; var iterable = generator(); for (let x of iterable)…
dvlsg
  • 5,378
  • 2
  • 29
  • 34
34
votes
10 answers

JavaScript ES6: Test for arrow function, built-in function, regular function?

Is there an elegant way to tell Harmony's slim arrow functions apart from regular functions and built-in functions? The Harmony wiki states that: Arrow functions are like built-in functions in that both lack .prototype and any [[Construct]]…
32
votes
3 answers

ES7 Getting result from an array of promises using await generator

Given an array of promises, what's the idiomatic way to get the results in ES7? Here's what I want to do: async function getImports() { let imports = [System.import('./package1.js'), System.import('./package2.js')]; let promises = await*…
Matt K
  • 4,813
  • 4
  • 22
  • 35
31
votes
5 answers

ES5 Object.assign equivalent

I wanted to do something which is very straight-forward using Object.assign. var firstObj = {name : "Saba H.", rollNo : 1}; var secondObj = {college : "WCE"}; var wholeObj = Object.assign(firstObj, secondObj); console.log(wholeObj); // {name :…
Saba
  • 3,418
  • 2
  • 21
  • 34
29
votes
1 answer

What is harmony and what are harmony exports?

What is this harmony exports? In fact, what is harmony? Background When I bundle stuff using Webpack and I look at the distribution source, it contains this one block always. // define getter function for harmony exports __webpack_require__.d =…
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
29
votes
5 answers

Converting Singleton JS objects to use ES6 classes

I'm using ES6 with the Webpack es6-transpiler per my article here: http://www.railsonmaui.com/blog/2014/10/02/integrating-webpack-and-the-es6-transpiler-into-an-existing-rails-project/ Does it make any sense to convert two Singleton objects to use…
justingordon
  • 12,553
  • 12
  • 72
  • 116
27
votes
2 answers

unexpected strict mode reserved word -- yield? Node v0.11, harmony, es6

Trying to use a new ES6 based node.js ODM for Mongo (Robe http://hiddentao.github.io/robe/) Getting "unexpected strict mode reserved word" error. Am I dong something wrong here? test0.js "use strict"; // Random ES6 (works) { let a = 'I am declared…
Robert Taylor
  • 459
  • 1
  • 4
  • 9
25
votes
1 answer

Why can functions be called without parentheses when using template strings?

I have a simple logging function: function log(str) { console.log('logged: ', str); } If I call it without parentheses (currently using Chrome's dev tools) and pass in a template string, like this: log`foo` The output is: logged: ["foo", raw:…
20
votes
2 answers

ES6 global import

What is the best way to import some modules in all of the files of the project, so I don't have to write stuff like: import React from 'react'; import Reflux from 'reflux'; import reactMixin from 'react-mixin'; in almost every single file?
Victor Marchuk
  • 13,045
  • 12
  • 43
  • 67
20
votes
5 answers

Enable Harmony Proxies in nodejs

Is it possible to enable EcmaScript 6 Harmony Proxies in nodejs? If so, what are the pros and cons? And is there any documentation on how to use them? Thanks !
Alexandre Kirszenberg
  • 35,938
  • 10
  • 88
  • 72
19
votes
1 answer

When will ES6 be available in IE?

This is a legitimate question if you really know the answer or can provide some information. Firefox and Chrome are continually working to include many of the features in ES Harmony... My question is really 2 parts: Does anyone know when ES6 will…
Nathan Wall
  • 10,530
  • 4
  • 24
  • 47
19
votes
5 answers

How to use five digit long Unicode characters in JavaScript

In JavaScript I can do this: foo = "\u2669" // 1/4 note But I can't do this foo = "\u1D15D" // full note -five hex digits It will be interpreted as "\u1D15" followed by "D" Are there any workarounds for this? UPDATE 2012-07-09: The proposal for…
itpastorn
  • 2,935
  • 1
  • 22
  • 24
1
2
3
15 16