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

How will browsers distinguish between ES5 and ES6 scripts?

There are much smaller differences in behaviour between ES5 and ES6. These differences may lead to errors in scripts written in ES5 while being interpreted by modern browser (supporting ES6). How does this problem can be addressed?
0
votes
1 answer

How to override method on Window in ES2015

I'm trying to rewrite an vanilla ES5 closure to a ES2015 Class. The code overrides the window.onerror function and acts as a global error handler method for logging purposes. My old code looks like this. I would like to know how to rewrite it in…
olefrank
  • 4,204
  • 7
  • 45
  • 75
0
votes
1 answer

Why I can not start harmony mode by "node --harmony test.js" from command line?

The problem is: longhao33@hePC:~$ node --harmony test.js /home/longhao33/test.js:1 (function (exports, require, module, __filename, __dirname) { let str = 'es666666666666'; …
lon
  • 21
  • 3
0
votes
1 answer

Object|Array.observe() implementation for ECMA 5

I found new useful experimental (in ECMA 7) method for Object and Array: observe. By the documentation you can subscribe for any changes in Object or Array. Unfortunately it is available only in Chrome 36 and Opera 23. Do someone have idea how to…
Maris
  • 4,429
  • 5
  • 33
  • 62
0
votes
0 answers

Do Classes and template strings work in Node 0.12.7 in harmony mode

I am able to run ES6 features like let, const, arrow functions in node 0.12.7 version using --harmony option, but classes and string templates do not work. for example: UserErrors.js: 'use strict'; class UserNotFoundError extends Error { …
Rohan
  • 599
  • 5
  • 16
0
votes
2 answers

How to access an object member from event callback function in a class object on Ecmascript 6 (ES6)

I've got this : class Register { render(){ return (
) }; aFunction(event){ this.printSomething(); //Uncaught TypeError: undefined is not a function } printSomething(){ …
SudoPlz
  • 14,037
  • 8
  • 67
  • 100
0
votes
1 answer

Javascript Map on Node, with EcmaScript

I'm using Map in NodeJS 0.10.36 by enabling harmony flag. I'm able to create a map, set and get data, but other methods like size, keys(), entries(), forEach yield undefined results. var k = new Map(); k.set('a', 1); k.set('b',…
0
votes
0 answers

is there any way to obtain a reference to (and use) an es6/2015 import in the same expression?

in node (common-js), i can do something similar to the following: resultA = require('objectA').key1; // resultB = require('functionB')(42); // resultC = require('functionC')(); with es6/2015 modules, i'm currently using something similar to…
tony_k
  • 1,777
  • 2
  • 19
  • 25
0
votes
2 answers

ES6 classes, member properties definitions as static/shared

I am testing classes in ES 6 with io.js 2.xx the example below I took from Mozilla, Things are getting on tracks (OOp in JS), at least we now have direct inheritance (at syntax level) with the 'extends' directive... the problem I pose is that member…
ZEE
  • 2,131
  • 3
  • 25
  • 35
0
votes
1 answer

How are proper tail calls enabled in ES5/strict mode?

Today, I was reading the harmony:proper_tail_calls proposal and I noticed that in the references there was a link which read, “Brendan discovers that ES5/strict enables TCO.” What does it mean that ES5/strict “enables” TCO? At first I thought that…
0
votes
1 answer

Parametric import with ES6 modules?

ES6 brings a nice module system into Javascript. Modules defined like this: export default { .... }; Can be easily imported into the source using import myLib from "myModule". But what if module exports a "constructor" function like this: export…
Vladislav Rastrusny
  • 27,954
  • 23
  • 85
  • 152
0
votes
1 answer

Creating a yieldable Node Module/Object

I am trying to create a Node module (using harmony) that upon loading by another module/application, has to be yielded to so that things in it's construct can be executed and loaded before any of it's exposed functions can be called. The issue I am…
aamirl
  • 1,060
  • 1
  • 9
  • 17
0
votes
0 answers

Is the order of Promise.all.then results guaranteed?

Assume this scenario: Promise.all( [p1, p2] ) .then( v => { //v[0] contains results of p1? }); Assuming that both p1 and p2 are resolved, is it safe to assume that v[0] will contain the result for p1 and v[1]will contain the result for p2?…
Luis Abreu
  • 3,136
  • 4
  • 28
  • 51
0
votes
2 answers

Using Promises in a qooxdoo application

In a qooxdoo class, I have a set of asynchronous methods that need to be chained (serialized): main: function() { async1(); }, async1: function() { var json = new qx.data.store.Json("http://..."); json.addListener("loaded",…
0
votes
2 answers

Turn on Harmony mode -- how do I do that in order to run ReactJS v0.13?

I am following this comment where I am told to turn on harmony mode in order to use destructing assignments for ReactJS v0.13. I have googled around and cannot find a good answer on how to turn this on. If turning on Harmony mode is a bad idea, what…
Kim Stacks
  • 10,946
  • 29
  • 130
  • 248