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

Support for Array Comprehension in Visual Studio

I've been reading up on the newer features of Javascript and noticed the Array Comprehension stuff. I've tried this in my current project, but it seems Visual Studio doesn't like the syntax. Am I doing it wrong? var destArray = [{propOne: val,…
2
votes
1 answer

Generators - thunkifying JSON.parse returns odd results

I am trying to read a JSON file using co and generators. test.json contains: { "hello": "world" } This passes jsonlint so it should be valid. Here is my code at present: #!/usr/bin/env node --harmony var co = require('co'), fs = require('fs'), …
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
2
votes
1 answer

Should I use TypeScript or ES6 to compile to es3/5

Am I correct in assuming that I will be able to switch from a typescript codebase to a pure ES6 codebase when it is supported enough by browsers? The question I am trying to answer to myself is whether I should I use typescript or ES6 + compiler to…
Nikos
  • 7,295
  • 7
  • 52
  • 88
2
votes
2 answers

Generator yield value difference

Let's we say that we have following generator function: var gen1 = function * (){ yield 1; }; And we have two more generators which yields above generator: var gen2 = function * () { yield gen1; }; var gen3 = function * () { yield…
user232343
  • 2,008
  • 5
  • 22
  • 34
2
votes
1 answer

Events happening before we can listen them in JS?

I have an image event handling code below as HTML Promise DEMO JavaScript var img1 =…
Mozak
  • 2,738
  • 4
  • 30
  • 49
2
votes
1 answer

Will it be possible to find out an object's class and module in ecmascript-harmony

When reading the ecmascript-harmony specification I cannot see anything about inspecting instances/objects in regards to find out information about their class and module. What I want to do is to be able to inspect a javascript object (that is an…
Erik
  • 21
  • 1
2
votes
1 answer

Running latest unstable nodejs (e.g. 0.11.6) on heroku

I've not been having much luck finding an answer to this: What is the simplest way to install/run the latest bleeding edge version of nodejs on heroku for an existing application? There is the use of package.json engines as described…
Face Book
  • 21
  • 1
2
votes
1 answer

Can calls to a module or class be intercepted in node.js/Javascript

In PHP every class contains a "magic" __call function. Using this one can dynamically intercept all calls to a class. For example using class TestClass { public function __call($functionname, $arguments) { .. functionname called …
user2692274
  • 145
  • 2
  • 5
2
votes
2 answers

Enable harmony proxies at runtime in node.js

I have a little RPC library for node, and right now it uses harmony proxies for remote objects if they are available (by checking for the existence of a Proxy global). I'd like to be able to turn harmony proxies on at runtime, that is, in a node…
jjm
  • 6,028
  • 2
  • 24
  • 27
2
votes
2 answers

Problems with extending regular Objects to support ES5 Array capabilities

I have long ago been willing to get the line between native Arrays and regular Objects totally blurred, not only extending Object with the same capabilities as Arrays got in ES5, but bundle up with my custom package of methods on both sides. Couple…
2
votes
1 answer

Harmony modules - How are platform differences handled?

I'm very interested in module loaders for node.js and also the new harmony modules specification. In general, I like the spec, but there is a problem that I'm not sure about how it is solved. If one wants to build a cross-platform JavaScript…
Van Coding
  • 24,244
  • 24
  • 88
  • 132
2
votes
2 answers

ES6 proxies cannot intercept array indices

Here is my test code (to be run using node --harmony-proxies foo.js: var a = Proxy.create({ get : function (proxy, prop) { return 5 } }) console.log(a['foo']) console.log(a.length) console.log(a['10']) console.log(a[10]) Why…
nponeccop
  • 13,527
  • 1
  • 44
  • 106
1
vote
1 answer

Usage of object destructuring in Array.reduce

I was trying to solve another person's problem on SO using Array.prototype.reduce and ...object destructuring. I don't understand why it works as expected when I'm using Object.assign, but not when using the spread operator. const str =…
connexo
  • 53,704
  • 14
  • 91
  • 128
1
vote
0 answers

Running a node command in harmony irrespective of OS

So for a *nix machine, it is possible to define a script like so: scripts: { "unit-test": "node --harmony `which jest` --config jest-unit.json" } This fails on Windows 10 as the which command is not platform agnostic. Is there a way to do this…
Abraham P
  • 15,029
  • 13
  • 58
  • 126
1
vote
0 answers

String literal to template literal

Is there a way to convert a string literal into a template literal in Javascript 2015? For example, something like the opposite of String.raw, like this: String.template('hello ${name}!') // returns `hello ${name}!` And if it doesn't exist, then…
risto
  • 1,274
  • 9
  • 11