Comments addressed

https://codereview.chromium.org/867153003/diff/40001/src/preparser.h
File src/preparser.h (right):

https://codereview.chromium.org/867153003/diff/40001/src/preparser.h#newcode515
src/preparser.h:515: bool has_extends,
On 2015/01/24 16:19:09, arv wrote:
I would prefer has_extends before is_static since that is more similar
to the
code order.

Done.

https://codereview.chromium.org/867153003/diff/40001/src/preparser.h#newcode2132
src/preparser.h:2132: kind = has_extends ?
FunctionKind::kSubclassConstructor
On 2015/01/24 16:19:09, arv wrote:
On 2015/01/24 02:45:14, Dmitry Lomov (chromium) wrote:
> On 2015/01/23 21:37:00, arv wrote:
> > Sad. This needs to be dynamic since an extends value of null needs
to be
> treated
> > as if no extends clause was present :'(
>
> That is fine. FunctionKind::kSubclassConstructor means in fact
"maybe subclass
> constructor" (conditioned on whether the actual extends value is
null or not).
>
> The key thing to achieve here is that we separate out the case where
'extends'
> is syntactically not present - in that case the receiver is
definitely never a
> hole, we definitely need no checks on 'this', we definitely cannot
use 'super'
> etc.

Resolved.

has_extends is just an optimization then? If it is false, we know that
the we
should not use the derived constructor. If it is true we might still
need to use
the derived constructor.

Yes, correct. Most importantly, normal functions are not derived
constructors, so there is no extra handling for holey `this`.

https://codereview.chromium.org/867153003/diff/40001/test/mjsunit/harmony/classes-experimental.js
File test/mjsunit/harmony/classes-experimental.js (right):

https://codereview.chromium.org/867153003/diff/40001/test/mjsunit/harmony/classes-experimental.js#newcode30
test/mjsunit/harmony/classes-experimental.js:30: return this;
On 2015/01/24 16:19:09, arv wrote:
Can you add a few more test cases?

1. A constructor without `return this`.
This is not implemented yet - coming next

2. A constructor with a second call to `super()` which should throw.
Done, actually required code changes.

https://codereview.chromium.org/867153003/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to