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

What is the difference between ECMAScript 6 and ECMAScript Harmony?

I thought that they were the same thing for a while, but I often see phrasing in blogs or in answers here that seems to imply that there is a difference between the two. Even SO has two distinct tags, but their description doesn't show any clear…
dee-see
  • 23,668
  • 5
  • 58
  • 91
5
votes
3 answers

How to identify an ES6 generator

Say I've got a generator function like this: var g = function*() { yield 1; yield 2; yield 3; }; var gen = g(); How can I tell programmatically that g is a generator function, or that gen is an iterator? This seems like one…
Dan Tao
  • 125,917
  • 54
  • 300
  • 447
5
votes
4 answers

Map() is not defined in Google Chrome

I've been searching for an answer but I'm only getting results regarding the Google maps API. I'm trying to use a map in JavaScript to map an integer to a string. Everything is working fine in Firefox but in chrome I get an error message in the…
Nick
  • 461
  • 2
  • 6
  • 16
5
votes
1 answer

Is Ember.js Object observer equivalent to ES6 Harmony Object.observe?

Looking at the new observe ES6 featues inside object, I was wondering whether Ember and ES6 are equivalent or different? Can we use the Watchjs polyfill safely with ember?
5
votes
2 answers

`this` in global scope in ECMAScript 6

I've tried looking in the ES6 draft myself, but I'm not sure where to look: Can someone tell me if this in ES6 necessarily refers to the global object? Also, will this object have same members as the global scope? If you could answer for ES5 that…
Nathan Wall
  • 10,530
  • 4
  • 24
  • 47
4
votes
2 answers

What does notifier.performChange actually do?

I am trying to understand Object.getNotifier(object).performChange. Conceptually I understand that it is designed for defining "macro" or higher level changes. From the example everyone seems to refer to: increment: function(amount) { var notifier…
user663031
4
votes
1 answer

Promise chaining: Use result from previous promise in next then callback

I'm using straight ES6 Promises (with the es6-promise polyfill library) and I'm running into a problem with accessing results from previous promises in chained ones. This problem is identical in the context of Angular/Q, but I'm dissatisfied with…
osdiab
  • 1,972
  • 3
  • 26
  • 37
4
votes
1 answer

Call a generator from generator

I would like to call a generator from another generator getting its "steps". Though I cannot find a good syntax for that. function* test1() { yield 2; yield 3; } function* test2() { yield 1; for (var i of test1()) yield i; // WTF …
polkovnikov.ph
  • 6,256
  • 6
  • 44
  • 79
4
votes
1 answer

Testing nodejs harmony generator method

Suppose you have the following JS function: function YourProxy($orm, $usr) { this.addToDB = function(obj) { /* Do some validation on obj */ return function(callback){ var oo = $orm.createNew(obj); …
Alessandro L.
  • 398
  • 1
  • 15
4
votes
2 answers

JSON and ES6 Maps and Sets?

ES6/Harmony introduces new data types for Maps and Sets. Is there anyway to load JSON into those types instead of the default Object and Array?
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
4
votes
2 answers

Restarting a Generator in Javascript

In node (0.11.9, with the --harmony flag), how do I restart a generator after it finishes? I tried doing generator.send(true); but it says the send() method doesn't exists.
Alix Axel
  • 151,645
  • 95
  • 393
  • 500
4
votes
2 answers

Can anyone else use let statements at their Node.js REPL?

Is it possible? It doesn't seem to work in my REPL, neither with nor without --harmony. What I'd really like to do is use for..of loops, but let seems a simpler thing to troubleshoot and is likely the same reason. Anyone know anything about the…
user2958725
  • 1,355
  • 3
  • 12
  • 16
4
votes
2 answers

JavaScript pattern for constructing proxy objects, using classical inheritance

Although not finalized, I am experimenting with ES6 Proxies. My goal is to have a constructor function (one that utilizes classical inheritance like the one shown below) for creating proxy objects with inheritance chains. function inherit(child,…
Mario
  • 6,572
  • 3
  • 42
  • 74
4
votes
1 answer

CoffeeScript classes and nosuchmethod

Assuming the presence of Harmony Proxies in the underlying Javascript engine, how could one construct a CoffeeScript superclass such that extending it would allow a class to define a noSuchMethod method (or methodMessing)? That method would be…
3
votes
3 answers

Good way to change an object's prototype to change results of instanceof?

I wanted to comment on this old question, but it appears to be locked. Here is my use case: An object obj is created with constructor Base. obj instanceof Base returns true. I want to change the prototype of obj such that it appears as if obj was…
John Freeman
  • 2,552
  • 1
  • 27
  • 34