HE Shi-Jun

Results 543 comments of HE Shi-Jun

I think async function could just return a rejected promise. The only important thing is the timing. ``` js function *g(a = A()) { console.log(11) yield a console.log(12) } const...

@MichaelTheriot CoffeeScript is *not* JavaScript, especially the syntax part, though it follow most JavaScript semantics. So it's ok CoffeeScript make any breaking changes to JavaScript, they already did. TypeScript is...

I think `var` is a better choice. `var` bring me to the old closure private pattern, in that era, we have no `let/const`. `let/const` has TDZ, which `var` (both function...

While I understand @allenwb 's concern of complexity, I also understand initialization is a very wanted feature, especially for those (like, React users) who do not use deep inheritance at...

@arackaf You always need TS for static type system, and you always need Babel for JSX support. > satisfy essential use cases seems inherently flawed We should agree JSX/static type...

This proposal is great! It avoid the main syntax issues in current proposals: 1. No `#priv` which most programmers *hate*. (Yes, they hate it.) 2. No new ASI hazard. (by...

@littledan I think even having initializers it will make much less *new* ASI hazards than current proposals. ```js class A { var x = 0 *gen() {} // syntax error...

@bakkot > one of which overloads an existing one with radically different semantics: var x, hidden foo(){} this->x, and static {}. - `var x`: I think this syntax is very...

@bakkot > which breaks a fundamental contract of variables in JavaScript Sorry I don't get this. Could you give a small example show the breaking contract? > It's not a...

@bakkot Ok, I see. But I will argue, for the guys who know plain old JS ```js class A { var x; f(){ return this->x; } } ``` is just...