Questions tagged [ecmascript-next]

For questions about upcoming ECMAScript features that are not scheduled to be part of a specific version yet (anything that is a stage 3 or lower proposal).

Proposals for new ECMAScript features follow a specific process, where they go through the following stages:

  • Stage 0 (Strawman)
  • Stage 1 (Proposal): The committee expects to devote time to examining the problem space, solutions and cross-cutting concerns
  • Stage 2 (Draft): The committee expects the feature to be developed and eventually included in the standard
  • Stage 3 (Candidate): The solution is complete and no further work is possible without implementation experience, significant usage and external feedback.
  • Stage 4 (Finished): The addition will be included in the soonest practical standard revision

Proposals in stage 4 are definitely added to one of the next releases of the language specification. This tag is for questions about proposals in stage 0 - stage 3.

Important Links:

405 questions
-1
votes
1 answer

How could I rewrite this without using arrow functions?

I don't understand how to untangle the double arrow binding. My linter does not like this ES7+ magic. export default class Login extends Component { handleChange = (fieldName) => (evt) => { this.setState({ [fieldName]:…
Josh Pittman
  • 7,024
  • 7
  • 38
  • 66
-1
votes
1 answer

Curried Functions are cached?

Curried functions gets cached by the compiler (some guy) This component below has two buttons, one calls a function which returns the onClick handler, the other does the same, but inline. According to my knowledge, both are doing the same thing,…
webdeb
  • 12,993
  • 5
  • 28
  • 44
-1
votes
1 answer

SyntaxError on static class property with Babel

I am trying to create a component using ES2016 syntax as: export default class { static defaultProps = { color: '#cc7f29', } } I believe static defaultProps = {} syntax is part of ES2016 so I loaded ES2016 preset into Babel. I have…
Swapnil Devesh
  • 224
  • 8
  • 19
-1
votes
1 answer

Class methods - which one to use and when?

There seems to be two different way to define a method within a class. class Foo { handleClick = e => { // handle click } // and handleHover(e) { // handle hover } } My question is what is the difference between…
abustamam
  • 1,597
  • 2
  • 13
  • 21
-2
votes
1 answer

Who is responsible for adding new JavaScript features?

Which organization is appointed for implementing new JS features? For example, adding a new reverse string capability, or anything else that would be introduced in ESNext?
-2
votes
4 answers

transpiler battle: breaking out of nested function, with vs without throw

I have just finished writing "version 0" of my first (toy) transpiler. It works. It turns a string of "pseudo JavaScript" (JavaScript with an additional feature) into a string of runnable JavaScript. Now, I want to improve it. The work area possibly…
mathheadinclouds
  • 3,507
  • 2
  • 27
  • 37
-2
votes
2 answers

Will JSON Evolve to Have Native Support for Ecmascript Map Objects?

Are there any formal proposals, in progress, that address a backwards-compatible evolution to JSON's current treatment of Map objects? For example, let say you want to convert a Map to JSON and then write it to file: let map = new Map(); map.set(1,…
Lonnie Best
  • 9,936
  • 10
  • 57
  • 97
-2
votes
3 answers

Can async functions be in class fields?

Consider the following snippet: class Foo { method = () => { console.log('method'); } } const f = new Foo(); f.method(); Works just fine. But, if the function is made async instead, with no other changes: class Foo { method =…
Snow
  • 3,820
  • 3
  • 13
  • 39
-2
votes
1 answer

Class properties: Access child class properties in parent constructor

I would like to build a ES6 class which can read it's child properties already on constructor level. In the other words I would like to have this specs passing: class Collection { model = 'model'; constructor() { // I JUST DO A SIMPLE…
michaltaberski
  • 633
  • 1
  • 10
  • 17
-2
votes
1 answer

Ecmascript Abstract Equality Comparison

The ECMAScript specification for "abstract equality comparison" (==) has changed between the 6.0 and 9.0 versions, adding an ! character in front of the ToNumber calls in some of the components of the comparison. Can someone tell me why ECMAScript…
-2
votes
1 answer

How do I get a proper "this" when a class method is called by an external class with arrow functions?

See the example below. Inside of a callback A.handleEvent, I was expecting "this" to be an instance of A instead of B, even though it is being called from B. class A { constructor() { this.text = 'A'; this.b = new B(this); } …
-2
votes
2 answers

Why does assignment using await within while expression not retain assigned value?

Given the JavaScript code function* gen(start = 0, stop = 5) { while (start < stop) yield ++start; } async function fn(g = gen()) { while (done = !await new Promise(resolve => setTimeout(resolve, 1000, g.next())) …
-3
votes
1 answer

assigning value to undefined and type of undefined in Javascript

In "non-strict" mode of javascript, We can assign value to undefined. I tried to assign it value but when I tried to print that value it's giving me strange results. let a = 10; undefined = 20; a = undefined; console.log(a); // undefined not…
Akshay Bande
  • 2,491
  • 2
  • 12
  • 29
-3
votes
1 answer

JS: And if every function return "this" as a default value?

I have a code design question. Consider the following code: thatObj.doThis().setThat().add().update(); To allow chaining, I'm often writing return this;, and sometimes, here or there I forget to do it, then I got an error. In many cases, I'm not…
Joseph Merdrignac
  • 3,510
  • 2
  • 19
  • 16
-4
votes
1 answer

how to use highstock in ecmascript?

here are an example of code that work, I create a graph import $ from 'jquery'; import Highcharts from 'highcharts'; class test { constructor(){ let chart = new Highcharts.chart('container', { chart: { …
Emiliano
  • 698
  • 9
  • 30
1 2 3
26
27