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

Why can't I extend everyone's pocket in nowjs?

I'm trying to provide functions in everyone's pocket of nowjs. I'd like to do so by _.extending everyone's pocket, i.e. everyone.now. For some reason which I cannot understand, _.extend fails to properly provide the function at the client side. This…
pimvdb
  • 151,816
  • 78
  • 307
  • 352
9
votes
1 answer

How to tell eslint to allow staged ECMA-Script dynamic imports

I want to use the now "Stage-3" proposal import(). If I lint my code with ESLint it's complaining about: Parsing error: 'import' and 'export' may only appear at the top level Which is correct for the static form of import but not for the new,…
4nduril
  • 279
  • 1
  • 10
9
votes
2 answers

Is Google starting to use Dart? Did they build a Closure (or GWT) to Dart compiler?

We are trying to decide if to use Dart for building a web app. We are looking for a technology that will stay highly relevant roughly for the next 5 years. Now that EcmaScript 6 specs are around the corner (should be out by the end of 2014) we can't…
Durden81
  • 966
  • 9
  • 25
9
votes
1 answer

What can we do with ES6 Generator that we cannot with for loop?

I went trough ES6 features and Generators caught my eye. One thing that sprang to mind is chaining Promise objects, that I could not do with loops. What other mechanics we will be able to do, that we could not before? I do understand this is broad…
Matas Vaitkevicius
  • 58,075
  • 31
  • 238
  • 265
9
votes
2 answers

Import existing library with JavaScript ES6 Modules

How can an existing library be loaded and run using JavaScript's ES6 Modules? For example, suppose I need to load an existing polyfill: import {poly} from "thirdParty/poly"; How can I run the imported poly script and load its properties into the…
d13
  • 9,817
  • 12
  • 36
  • 44
9
votes
3 answers

In ES6, what happens to the arguments in the first call to an iterator's `next` method?

If you have an generator like, function* f () { // Before stuff. let a = yield 1; let b = yield 2; return [a,b]; } And, then run var g = f(); // this question is over this value. g.next(123); // returns: { value: 1, done: false…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
9
votes
6 answers

Run a node shell script in --harmony mode

How can I run a globally-installed node module that exposes a shell script in --harmony mode?
bitpshr
  • 1,033
  • 2
  • 9
  • 21
8
votes
3 answers

Is an IIFE required around class in ECMAScript / Javascript 6?

If I have Class Car {} do I need to wrap that with our function closure? Do var's get hoisted to window? or just to the class? What about when transpiled? Does Traceur/babel turn it into a IIFE and let's into var's? Do I need to: (function(){ …
webdevinci
  • 310
  • 3
  • 10
8
votes
3 answers

How to run gulp with --harmony flag?

The same could be achieved in node.js using --harmony flag like this: node --harmony app.js So it will be add support for EcmaScript6. How to run gulp commands with harmony flag?
FelikZ
  • 2,976
  • 4
  • 32
  • 41
8
votes
1 answer

babel/6to5 - duplicated code when exporting modules

I'm using Babel to transpile ES6 to ES5 and it works great. The only problem is that once transpiled each module duplicates these lines: var _get = function get(object, property, receiver) { var desc = Object.getOwnPropertyDescriptor(object,…
juli1bin
  • 83
  • 4
8
votes
1 answer

Does Google Canary browser support generators of ES6?

I need to test/work generators that are part of the ES6 draft. To work on I need a browser(in my case). As Google Canary is strictly for developers, so does it support generators as of now? My OS is Windows 7.
Mozak
  • 2,738
  • 4
  • 30
  • 49
7
votes
1 answer

Can I specify es6 inside node js file

In order to use es6, we pass the harmony flag in the command line node --harmony myscript.js Is there a way to do this from inside the file, such as use harmony? #! /usr/bin/node use harmony class MyScript { constructor (options) { …
Shanimal
  • 11,517
  • 7
  • 63
  • 76
7
votes
1 answer

How does Object.observe/unobserve interact with garbage collection?

Does having an active Object.observe on an object prevent it from being garbage collected? Do you need to first call Object.unobserve to allow it to be garbage collected? Or does GCing an object remove all its active observers?
alexp
  • 3,587
  • 3
  • 29
  • 35
7
votes
1 answer

What's the difference between "new" and directly invoking a generator function?

I know the difference between "new" and directly invoking a normal function. But how about the case for the generator function? e.g: function *counter(){ let n = 0; while (n < 2) { yield n++; } return 10; } var countIter1 =…
kelviN
  • 975
  • 6
  • 16
7
votes
2 answers

Intellij Idea Ecmascript Harmony modules syntax

Im using Intellij Idea for some ES Harmony app. With modules syntax I want my IDE to do not highlight this as errors: import $ from "jquery"; I have turned ES Harmony support in project settings, but it does not help. Thanks!
Sergey Kamardin
  • 1,640
  • 1
  • 18
  • 22