https://codereview.chromium.org/1127063003/diff/100001/src/bootstrapper.cc
File src/bootstrapper.cc (right):
https://codereview.chromium.org/1127063003/diff/100001/src/bootstrapper.cc#newcode1730
src/bootstrapper.cc:1730:
EMPTY_NATIVE_FUNCTIONS_FOR_FEATURE(harmony_optional_params)
Nit: harmony_default_parameters
https://codereview.chromium.org/1127063003/diff/100001/src/flag-definitions.h
File src/flag-definitions.h (right):
https://codereview.chromium.org/1127063003/diff/100001/src/flag-definitions.h#newcode197
src/flag-definitions.h:197: V(harmony_optional_params, "harmony optional
parameters")
Nit: s/optional/default/
https://codereview.chromium.org/1127063003/diff/100001/src/parser.cc
File src/parser.cc (right):
https://codereview.chromium.org/1127063003/diff/100001/src/parser.cc#newcode3575
src/parser.cc:3575: proxy->var()->set_maybe_assigned();
Why is this set?
https://codereview.chromium.org/1127063003/diff/100001/src/parser.cc#newcode3585
src/parser.cc:3585: // TODO(caitp): ensure proper TDZ behaviour --- need
hole-check for
Nit: this comment seems obsolete
https://codereview.chromium.org/1127063003/diff/100001/src/parser.cc#newcode4301
src/parser.cc:4301: body->AddAll(*inner_body, zone());
Shouldn't this create a block statement instead?
https://codereview.chromium.org/1127063003/diff/100001/src/scopes.cc
File src/scopes.cc (right):
https://codereview.chromium.org/1127063003/diff/100001/src/scopes.cc#newcode513
src/scopes.cc:513: void Scope::ShadowParametersForExpressions() {
Instead of spreading this out into a different function, can't we do
that during desugaring, right before invoking re-Declare on the
respective variable in DesugarInitializedPArameters?
https://codereview.chromium.org/1127063003/diff/100001/test/mjsunit/harmony/optional-arguments.js
File test/mjsunit/harmony/optional-arguments.js (right):
https://codereview.chromium.org/1127063003/diff/100001/test/mjsunit/harmony/optional-arguments.js#newcode55
test/mjsunit/harmony/optional-arguments.js:55:
More tests, e.g.:
- (function(x = this) { return x }).call(o) === o
- (function(x = () => this) { return x() }).call(o) === o
- (function f(x, y = f) { return x ? y(false) + 1 : 0 })(true) === 1
- (function(x, y = function() { return x }) { return y() })(7) === 7
- (function(x = function() { return y }, y) { return x() })(8) === 8
- (function(x, y = eval("x")) { let x; return y })(7) === 7
- (function(x = eval("y"), y = 0) {})() throws
- (function(x, y = () => eval("x")) { let x; return y() })(7) === 7
- (function(x = () => eval("y"), y = 9) { let y; return x() })() === 9
- (function(x = {a: 4}) { return x.a })() === 4
- (function(x, y = {a: x}) { return y.a })(5) === 5
- a function large enough to trigger lazy parsing
https://codereview.chromium.org/1127063003/
--
--
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.