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
7
votes
3 answers

Enable Harmony ES6 features in V8 at runtime in a module?

Node v0.10.20 provides many options pertaining to harmony, --harmony_typeof (enable harmony semantics for typeof) --harmony_scoping (enable harmony block scoping) --harmony_modules (enable harmony modules (implies block scoping) --harmony_proxies…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
7
votes
1 answer

Access [[NativeBrand]] / [[Class]] in ES6 (ECMAScript 6)

I was reading over the draft for ES6, and I noticed this note in the Object.prototype.toString section: Historically, this function was occasionally used to access the string value of the [[Class]] internal property that was used in previous …
Nathan Wall
  • 10,530
  • 4
  • 24
  • 47
6
votes
3 answers

Required context `router` was not specified. Check the render method of `RoutingContext`

My app is ES6 React application with react-router. I want to redirect user to a different page after a small delay. Here is my React component: import React from 'react' import { Navigation } from 'react-router' export default class Component…
zaaath
  • 737
  • 9
  • 17
6
votes
2 answers

Co.js and bluebird.js -- what's the difference?

Could someone help me understand the differences between using Koa.js and Bluebird.js with ES6 Harmony. Specifically, how does co( function * () { //stuff } ); compare to, Promise.coroutine( function * () { //stuff } ); It just seems Koa…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
6
votes
4 answers

How to add --harmony node flag to grunt-express

I'm using grunt-express to do local development. here is my GruntFile.js var path = require('path'); module.exports = function(grunt){ grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), uglify:{ options:{ …
Chadams
  • 1,833
  • 1
  • 18
  • 15
6
votes
1 answer

How to enable harmony in Coffeescript?

Here is how I run my js code: node --harmony ./data/app.js Now I want to move to the CoffeeScript. So I try to run it like that: coffee ./data/app.coffee And it fails. How can I pass this --harmony option?
ciembor
  • 7,189
  • 13
  • 59
  • 100
5
votes
2 answers

how to inspect/iterate over an object in node?

I'm getting a result (the object) back from a mongoose query and want to replace/remove some keys, before I stringify the object and send it to the client. When I console.log the object, everything is nice (all the keys are listed, nothing more).…
japrescott
  • 4,736
  • 3
  • 25
  • 37
5
votes
2 answers

Shallow copy object leaving out one or more properties in ES6/ES7?

This is how I've been doing it: var props = { id: 1, name: 'test', children: [] } //copy props but leave children out var newProps = { ...props } delete newProps.children console.log(newProps) // { id: 1, name: 'test' } Is there a…
5
votes
1 answer

Prototype chains in ECMAScript 6

I recently came across this great post by Dr. Axel Rauschmayer: http://www.2ality.com/2015/02/es6-classes-final.html The following snippet roughly describes how ECMAScript 6 prototype chains work from an ECMAScript 5 point of view (section 4.2 of…
stratis
  • 7,750
  • 13
  • 53
  • 94
5
votes
4 answers

Is there a way to run es6 components, specifically promises and generators, in aws lambda functions

ES6 usage requires --harmony flag in node v0.12.3. Is there a way to do so for an aws lambda function?
Swaraj Giri
  • 4,007
  • 2
  • 27
  • 44
5
votes
3 answers

Is it impossible to tell if a function is a generator function if .bind() has been called on it?

Looks like calling .bind(this) on any generator function breaks my ability to see if the function is a generator. Any ideas on how to fix this? var isGenerator = function(fn) { if(!fn) { return false; } var isGenerator =…
Kirk Ouimet
  • 27,280
  • 43
  • 127
  • 177
5
votes
2 answers

How to test harmony / ES6 / ECMAScript 6 JavaScript?

As per the title, I'm trying to test some AMD modules written in ES6 JS, running from nodejs. I tried first with Intern: even after enabling --harmony in nodejs, I ended up facing Intern's dependency chain, where I was not able to enable Harmony in…
superjos
  • 12,189
  • 6
  • 89
  • 134
5
votes
4 answers

How to enable harmony syntax support in coffeescript?

I used node.js(0.11.13) with --harmony flag and used function *() and yield keywords. I tried to simplify my development on node.js with help of coffeescript, so far it works great but I went into troubles with yield and declaring a generator - it…
let4be
  • 1,048
  • 11
  • 30
5
votes
2 answers

JavaScript native Promise() without callback

Look at this jQuery code: var promise = new Deferred(), some; some = function(promise) { // do cool things promise.resolve(); }; promise.then(/* callback cool things */); // init everything some(promise); I am not sure about…
Boris Zagoruiko
  • 12,705
  • 15
  • 47
  • 79
5
votes
1 answer

Node can't enable harmony features

Trying to run these new features as shown http://h3manth.com/new/blog/2013/es6-on-nodejs/, specifically Generators in my local node environment. Any reason when I run node --harmony --use-strict es6.js on any Node versions before 0.11.4 I get the…
Marius Miliunas
  • 1,023
  • 18
  • 34