All done, landing
https://codereview.chromium.org/908883002/diff/140001/src/arm/full-codegen-arm.cc
File src/arm/full-codegen-arm.cc (right):
https://codereview.chromium.org/908883002/diff/140001/src/arm/full-codegen-arm.cc#newcode266
src/arm/full-codegen-arm.cc:266:
IsSubclassConstructor(info->function()->kind())
On 2015/02/10 20:15:18, arv wrote:
Do we do the right thing in the following case?
class C {
constructor() {
assertEquals(C, new.target);
}
}
new C();
The function above is not a subclass constructor.
Maybe this is just a TODO?
Yes, we do not support new.target in general yet, just passing
new.target through subclass constructor.
Maybe add a function to SHF called, HasNewTarget()?
I will add that when we support new.target proper
https://codereview.chromium.org/908883002/diff/140001/src/scopes.cc
File src/scopes.cc (right):
https://codereview.chromium.org/908883002/diff/140001/src/scopes.cc#newcode326
src/scopes.cc:326: variables_.Declare(this,
ast_value_factory_->new_target_string(), VAR,
On 2015/02/10 20:15:18, arv wrote:
Shouldn't this be CONST?
Done.
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js
File test/mjsunit/harmony/classes-experimental.js (right):
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js#newcode89
test/mjsunit/harmony/classes-experimental.js:89: super(tmp(),4);
On 2015/02/10 20:15:18, arv wrote:
Because left to right execution?
I realized this is not correct under the new spec. super call needs to
happen and then we validate that 'this' has not been initialized yet.
I'll fix in sparate CL (this CL does not change that behaviour)
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js#newcode90
test/mjsunit/harmony/classes-experimental.js:90: } catch(e) { exn = e; }
On 2015/02/10 20:15:18, arv wrote:
ws after catch
Done.
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js#newcode91
test/mjsunit/harmony/classes-experimental.js:91: assertTrue(exn !==
null);
On 2015/02/10 20:15:18, arv wrote:
instanceof test would be better
Done.
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js#newcode127
test/mjsunit/harmony/classes-experimental.js:127: assertTrue(s.__proto__
=== Subclass.prototype);
On 2015/02/10 20:15:18, arv wrote:
assertSame here too
Done.
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js#newcode145
test/mjsunit/harmony/classes-experimental.js:145: let s_2 = new
Subclass2();
On 2015/02/10 20:15:18, arv wrote:
no underscores in js
Done.
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js#newcode151
test/mjsunit/harmony/classes-experimental.js:151: super(x+y);
On 2015/02/10 20:15:18, arv wrote:
ws around binops
Done.
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js#newcode185
test/mjsunit/harmony/classes-experimental.js:185: return new Object();
On 2015/02/10 20:15:18, arv wrote:
in general, prefer {} over new Object()
Done.
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js#newcode205
test/mjsunit/harmony/classes-experimental.js:205: let f =
Subclass.bind(new Object());
On 2015/02/10 20:15:18, arv wrote:
maybe
let obj = {};
let f = Subclass.bind(obj);
and assert that `this !== obj` in the constructor.
Done.
https://codereview.chromium.org/908883002/diff/140001/test/mjsunit/harmony/classes-experimental.js#newcode205
test/mjsunit/harmony/classes-experimental.js:205: let f =
Subclass.bind(new Object());
On 2015/02/10 20:15:18, arv wrote:
Bind a parameter too.
let f = Subclass.bind({}, 1);
Done.
https://codereview.chromium.org/908883002/
--
--
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.