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

Javascript proxies: node-proxy, Harmony, mixed objects with magic getters and setters... in Coffeescript?

I would like to have a proxied object with methods and private variables attached to it. That is to say, all normal object properties: foo = {} foo.bar = "baz" foo.boo = "hoo" with some prototypes: foo.setPrivateThings = function(value){ if (value)…
3
votes
2 answers

Object property constants in ECMAScript?

I've seen some proposals for ECMAScript Harmony in terms of being able to specify constants with the keyword const. However, it seems to be only available in block scopes (i.e., FunctionBody and Program). Is there a way to define constants as an…
Tower
  • 98,741
  • 129
  • 357
  • 507
3
votes
1 answer

Restructuring TypeScript internal modules to external modules

I have a website that uses a large typescript code base. All clases as in their own files, and wrapped with an internal module like so: file BaseClass.ts module my.module { export class BaseClass { } } file ChildClass.ts module my.module { …
user210757
  • 6,996
  • 17
  • 66
  • 115
3
votes
2 answers

Does the ES7 decorator spec require descriptors to have an `initializer` method

Using Babel to transpile the following es7 code: let obj = { @decorate prop: 10 } let decorate = ( object, propertyName, desc ) => desc When decorate is called, the property descriptor desc contains a method named initializer, that returns the…
3
votes
2 answers

Is there a way to unleash the full might of ES6 with React JSX?

I'm currently using browserify with reactify plugin to compile jsx code for ReactJS components. This allows me to use certain subset of ES6 in the code (arrow functions, string interpolation etc). Is there a possibility to use full ES6 (having it…
Vladislav Rastrusny
  • 29,378
  • 23
  • 95
  • 156
3
votes
1 answer

Create a map with same values and keys the FP way using ES6/Harmony

Given a set of "Apple", "Banana", and "Orange", create the following: { "Apple": "Apple", "Banana": "Banana", "Orange": "Orange" } that is, each string becomes the key as well as the value. (That is, by the way, what Facebook's little KeyMirror JS…
3
votes
2 answers

ECMAScript 6's function.name property

Quick question: what's the correct result for this code: let f = function(){}; let n = f.name; //"" or "f"? According to the compat table, n should have the value "f". However, the mozilla docs say that it should return an empty string. Which one…
Luis Abreu
  • 4,008
  • 9
  • 34
  • 63
3
votes
1 answer

ES6 Generators- Example where there is no yield expression for the first next()

For ES6 generators, why does the author of this blog post say: from: http://davidwalsh.name/es6-generators "The first next(..) call, we don't send in anything. Why? Because there's no yield expression to receive what we pass in." Doesn't the first…
dman
  • 10,406
  • 18
  • 102
  • 201
3
votes
3 answers

Subclassing ES6 Set in javascript

I'm running into problems when trying to inherit from the new Set available in ecmascript 6. The class is defined as such: function SelectionManager () { Set.call(this); } SelectionManager.prototype =…
Linus Unnebäck
  • 23,234
  • 15
  • 74
  • 89
3
votes
1 answer

How do ES6 generators assist with non-blocking code?

I've been experimenting with ES6 generators in Node now for a little while, and there's still one issue that I don't understand. In regular callback Node, getting a value from a database and doing something else in parallel would look something like…
user3181113
  • 758
  • 2
  • 11
  • 23
3
votes
3 answers

How can I invoke a callback given to a yield in javascript v8 generator code?

I'm attempting to understand javascript generators in node.js v8, without using any third party libraries. I want to try having a generator that invokes an asynchronous callback (something like a web request) and returns the value that is called…
Oved D
  • 7,132
  • 10
  • 47
  • 69
3
votes
0 answers

ECMAScript 6 to ECMAScript 3 transpiler?

I'm familiar with the Google Traceur project (which is considered ready for production use in critical systems) as a transpiler from ECMAScript 6 to ECMAScript 5; unfortunately I still have to support IE 8 which is only compatible up to ECMAScript…
3
votes
3 answers

ES6 Template String testbed

I'm really interested in finding out about ES6 Template Strings and have been doing a little bit of reading on the feature. However now that Chrome Canary does not support it (although maybe I'm wrong about that!) is there anywhere/anything I can…
CodingIntrigue
  • 75,930
  • 30
  • 170
  • 176
3
votes
1 answer

ES6 Symbols in Chrome

I'm experimenting with the new ES6 Symbols in Google Chrome, and after enabling "Experimental JavaScript" in Chrome Flags, I can use new Symbol() in my code. However, when I try to run the following code: var sym = new Symbol(); var obj =…
urish
  • 8,943
  • 8
  • 54
  • 75
3
votes
1 answer

Performance of ES6 class inheritance

Compared to the actual way of creating "classes" in Javascript as such: function MyClass(){ } MyClass.prototype.yada = function(){}; to the new ES6 class class MyClass { yada(){ } } Couldn't find any performance comparisions, but I'm really…
pocesar
  • 6,860
  • 6
  • 56
  • 88