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:

379 questions
-1
votes
1 answer

Is it safe to use Javascript Decorators in production?

I'm having a little trouble keeping up with the decorators in javascript. I would really like to use them for my React Native project, it would allow me to have a more readable code. But is it safe to use the Pure Javascript decorators for the…
Viktor Jovanovic
  • 361
  • 1
  • 12
-1
votes
1 answer

What makes ES6 so special?

So I've only recently started to dive head first into web development. One thing I gathered very quickly was that ES5 = old, and ES6 = shiny and new. I figured ES6 was the latest and greatest ES had to offer. But I just found out that ES6 is 3…
-1
votes
2 answers

Difference between finally() and then() in ES2018

Before ES2018, I used to nest an extra then at the end of the promise chain whenever I had to perform any clean up logic that I'd otherwise duplicate in then and catch above, e.g. new Promise( (res, rej) => setTimeout(() => rej({}),…
Alex
  • 2,989
  • 3
  • 27
  • 52
-1
votes
1 answer

Figuring out the @ symbol in this context

https://github.com/react-dnd/react-dnd/blob/master/examples/04%20Sortable/Simple/Card.js I'm trying to figure out what the @ symbol in this example means. It's supposed to be a simple drag and drop example, but having the examples in i'm assuming…
user1189352
  • 3,534
  • 9
  • 43
  • 77
-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
  • 5,021
  • 4
  • 26
  • 51
-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
  • 11,890
  • 5
  • 24
  • 41
-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
  • 4
  • 18
-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,317
  • 2
  • 12
  • 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
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
  • 6,765
  • 9
  • 44
  • 81
-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,828
  • 3
  • 7
  • 34
-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
  • 563
  • 1
  • 9
  • 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())) …
1 2 3
25
26