Joe Pea

Results 1897 comments of Joe Pea

On this part, https://github.com/Mr0grog/newless/blob/3fe059f3f8ac26d945afb01c880dd68d2e61d631/newless.js#L41-L48 is there an advantage of using `class` there? Or would using spread with `new constructor(...([].slice.call(args)))` work just as fine?

How about something like this one? ```js return Function("constructor, args, target", "'use strict';" + // spec: TypeError if third arg is explicitily undefined "if (arguments.length === 3 && typeof target...

If `supportsSpread` is false, then it calls constructor directly, which is the same problem.

Plus, later on, you have the lines ```js // fix up the prototype so it matches the intended one, not one who's // prototype is the intended one :P "Object.setPrototypeOf(value,...

That's why I was copying the non-supportsSpread version (instantiating constructor directly), figuring it worked the same. With the `class` instantiator, those last two lines just remove the instantiator prototype, but...

Seems to work, try this in Chrome console: ```js var supportsSpread = true; var construct = Function("constructor, args, newTarget", "'use strict';" + "if (arguments.length === 3 && typeof newTarget ===...

Oops, I had `Reflect.construct` in that last example. I updated it to just `construct` which works.

I have a [question about your example](https://esdiscuss.org/topic/extending-an-es6-class-using-es5-syntax#content-20) on ES Discuss. How does that magic work?

Got it! What it boils down to is simple ES5-like behavior, ```js const self = Object.create(X.prototype) Y.apply(self) return self ``` , except not. I wish ES6 didn't introduce classes that...

I like where this is going. I'm a JS developer, so it's nice to be able to write with the elm-like patterns but in JS. The pain point I noticed...