08:06
<ystartsev>
thanks bradleymeck & devsnek
20:47
<jorendorff>
Is this a spec bug? `Reflect.construct(Object, [], class C {})` seems like it'll trip an assertion in the spec
20:48
<ljharb>
jorendorff: which assertion?
20:48
<jorendorff>
because classes have [[Construct]], but IsCallable(C) is false
20:48
<ljharb>
no it's not
20:48
<ljharb>
(unfortunately) classes have a [[Call]] slot with an error-throwing function in it
20:49
<jorendorff>
oh, that makes sense
20:49
<jorendorff>
I was thinking of step 2 of https://tc39.es/ecma262/#sec-getprototypefromconstructor
20:49
<ljharb>
imo it doesn't make sense :-) it'd be much better if classes lacked a [[Call]]
20:49
<ljharb>
and we could still change that! but it'd require non-observable changes to `typeof`, and observable changes to Proxy
20:49
<ljharb>
and lots of non-observable spec changes
20:50
<jorendorff>
i knew that, just blanked on it
20:50
<devsnek>
some people have been known to use proxies to check for construct slots
20:50
<ljharb>
devsnek: the change i'd like to make wouldn't break that; it'd just let you *also* check for call slots.
20:51
<jorendorff>
...which you can also do, but you'd get a different answer for classes
20:51
<devsnek>
when was [[Construct]] added
20:51
<ljharb>
jorendorff: true
20:51
<ljharb>
devsnek: ES6
20:51
<devsnek>
sad
20:52
<devsnek>
should've just not had [[Construct]] imo
20:52
<ljharb>
that's also an alternative
20:52
<ljharb>
or was
20:52
<jorendorff>
alas :)
20:53
<devsnek>
its kind of interesting that all engines implement tail calls for Function.prototype.call and Reflect.call and such