LGTM with comments

https://codereview.chromium.org/766663003/diff/1/src/compiler.cc
File src/compiler.cc (right):

https://codereview.chromium.org/766663003/diff/1/src/compiler.cc#newcode792
src/compiler.cc:792: Statement* stmt = body->at(super_call_index);
Perhaps add

CHECK(super_call_index < body->length())  // We know there is a super
call.

before this line, for extra clarity.

https://codereview.chromium.org/766663003/diff/1/src/messages.js
File src/messages.js (right):

https://codereview.chromium.org/766663003/diff/1/src/messages.js#newcode185
src/messages.js:185: super_constructor_call:        ["'super(...)'
constructor call is currently only supported if it is the first
statement of a constructor and its arguments do not access 'this'"],
Suggestion:

"A 'super' constructor call may only appear as the first statement of a
function, and its arguments may not access 'this'. Other forms are not
yet supported."

https://codereview.chromium.org/766663003/diff/1/src/objects.h
File src/objects.h (right):

https://codereview.chromium.org/766663003/diff/1/src/objects.h#newcode6834
src/objects.h:6834: // Indicates that this function uses super property.
This is needed to set up
Nit: ...uses a super property.

https://codereview.chromium.org/766663003/diff/1/src/objects.h#newcode6839
src/objects.h:6839: // Indicates that this function uses super
constructor.
Nit: ...uses the super constructor.

https://codereview.chromium.org/766663003/diff/1/test/mjsunit/harmony/classes.js
File test/mjsunit/harmony/classes.js (right):

https://codereview.chromium.org/766663003/diff/1/test/mjsunit/harmony/classes.js#newcode782
test/mjsunit/harmony/classes.js:782: (function
TestSuperCallSyntacticRestriction() {
Add tests for nested calls, e.g.:

  constructor() { { super() } }
  constructor() { if (1) { super() } }

Also add some positive tests here, e.g.:

  constructor() {}
  constructor() { super() }
  constructor() { 0 }
  constructor() { "" }
  constructor() { ""; super() }

https://codereview.chromium.org/766663003/

--
--
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