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

Co.js app reports "TypeError: Cannot call method 'apply' of undefined"

When ever I try to run my Co.app I get TypeError: Cannot call method 'apply' of undefined at /home/ecarroll/code/chrome-okc-plugin/node_modules/thunkify/index.js:32:8 at /home/ecarroll/code/chrome-okc-plugin/test.js:12:17 at…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
0
votes
2 answers

TypeScript compile .js

I want to use typescript in ES6-compatible mode, as a partial replacement for ES6 classes, because it is quite convenient and clear compiler, comparing to traceur/sweet.js macros. How can I compile files with .js extension? tsc src/util.js gives…
dy_
  • 6,462
  • 5
  • 24
  • 30
0
votes
2 answers

Trying to `yield` to a `co( fn ).call`

I'm having a problem getting co to resume when also changing it's context value: var co = require( 'co' ); function *foo( next ){ console.log( 'foo yielding' ); yield next; console.log( 'foo yielded' ); return 42; } var bar = co(…
user578895
0
votes
2 answers

How can we use generators to write async code in a sync way?

I have read that generators, coming with ECMAScript 6 and already available in node.js dev version, will make easier to write async code in a sync way. But it was really hard to understand to me, how can we use generators to write async code ?
jillro
  • 4,456
  • 2
  • 20
  • 26
0
votes
1 answer

In ES6, how do you get the name of the generator function inside the generator?

Using normal ECMAScript you can do something like, function f () { console.log(this.constructor.name); } new f() // outputs `f` However, a slight modification, function* f () { console.log(this.constructor.name); } var g = new f(); g.next() //…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
0
votes
1 answer

In Node v.0.12, will there be any method to iterate over Map()?

If you create a Map() is there any method whatsoever to iterate over it? I know Node 0.12 isn't out yet, but 0.11.x is well on it's way and I can't figure it out in the devel branch, var m = new Map(); m.set('foo', 'bar'); Without knowing 'foo', is…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
0
votes
1 answer

Harmony ES6 constructor types for Map vs Object?

How come when I create a Map it requires new and it is not required on an Object? var o = new Object(); var m = new Map(); var constructorObject = o.constructor; var constructorMap = m.constructor; var newObject = constructorObject(); var newMap =…
Evan Carroll
  • 78,363
  • 46
  • 261
  • 468
0
votes
1 answer

Syntax highlighting errors in PhpStorm 7.1

I got syntax highlighting errors in PhhpStorm when using the EcmaScript6 (harmony version) module syntax. When I use this code (to be sure its not a fault): https://github.com/stefanpenner/ember-app-kit-todos/blob/master/app/models/todo.js Then I…
DelphiLynx
  • 911
  • 1
  • 16
  • 41
0
votes
1 answer

In Draft ECMAScript 6, what's the rationale behind using StopIteration exception to signal the end of iteration?

In Draft ECMAScript 6 Specification, what's the rationale behind using StopIteration exception to signal the end of iteration instead of using a dedicated method (hasNext in Java/Scala, and MoveNext in C#) to check for the end of iteration.…
shengmin
  • 319
  • 1
  • 3
  • 13
0
votes
1 answer

Implement a javascript sandbox using new Harmony direct proxies

I found this gist to implement a sandbox for 3rd-party code using with and the Harmony direct proxies. How useful is it? Would it be possible to implement a proper javascript sandbox using proxies? What are the quirks and / or downsides of this…
janesconference
  • 6,333
  • 8
  • 55
  • 73
0
votes
1 answer

ES6: Public Symbols vs Private Symbols

I have been searching for discussions about how to specify a symbol as public or private in ECMAScript 6. As I undertand it, a private symbol would be created using a pattern similar to the following: var itemManager = (function() { var items =…
Nathan Wall
  • 10,530
  • 4
  • 24
  • 47
0
votes
1 answer

Es6: ability to call custom methods on set/update/delete of object properties?

I believe I've read that the upcoming ES6 definition enables calling custom definable methods when an object property is set, updated or deleted. However, I can't find the blogpost anymore to back that up. Is this correct? I believe this…
Geert-Jan
  • 18,623
  • 16
  • 75
  • 137
-1
votes
1 answer

Is it possible to use generators in node v0.12.0?

I thought node v0.12.0 would support generators but I cannot get it to work. Unfortunately, I haven't found any clear statements whether generator are supported or not. This is what I tried: # example.js "use strict"; function simpleGenerator(){ …
Philipp Claßen
  • 41,306
  • 31
  • 146
  • 239
-2
votes
3 answers

Compelling ECMAScript 6 Destructuring use cases

Why was destructuring introduced to ECMAScript 6?
Sam Leach
  • 12,746
  • 9
  • 45
  • 73
1 2 3
15
16