Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1255)

Unified Diff: test/mjsunit/harmony/destructuring.js

Issue 1287063004: [es6] Implement default parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix TODO Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/parser.cc ('K') | « test/mjsunit/harmony/default-parameters-debug.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/destructuring.js
diff --git a/test/mjsunit/harmony/destructuring.js b/test/mjsunit/harmony/destructuring.js
index 05013c2a3aea8afe1504381d2f31c539f6c13cc6..69e144b26fd2a190cc233ef70c49f6eb12f04234 100644
--- a/test/mjsunit/harmony/destructuring.js
+++ b/test/mjsunit/harmony/destructuring.js
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Flags: --harmony-destructuring
-// Flags: --harmony-arrow-functions --harmony-rest-parameters
+// Flags: --harmony-destructuring --harmony-arrow-functions
+// Flags: --harmony-default-parameters --harmony-rest-parameters
(function TestObjectLiteralPattern() {
var { x : x, y : y } = { x : 1, y : 2 };
@@ -723,13 +723,14 @@
(function TestExpressionsInParameters() {
+ function f0(x = eval(0)) { return x }
+ assertEquals(0, f0());
function f1({a = eval(1)}) { return a }
assertEquals(1, f1({}));
function f2([x = eval(2)]) { return x }
assertEquals(2, f2([]));
function f3({[eval(7)]: x}) { return x }
assertEquals(3, f3({7: 3}));
- // TODO(rossberg, caitp): Add tests for default parameters.
})();
@@ -819,7 +820,7 @@
})();
-(function TestParameterTDZ() {
+(function TestParameterDestructuringTDZ() {
function f1({a = x}, x) { return a }
assertThrows(() => f1({}, 4), ReferenceError);
assertEquals(4, f1({a: 4}, 5));
@@ -943,7 +944,6 @@
assertEquals(5, f7({a: 5}));
function f8(x, ...a) { a = []; return arguments[1] }
assertEquals(6, f8(5, 6));
- // TODO(rossberg, caitp): Add cases for default parameters.
}());
« src/parser.cc ('K') | « test/mjsunit/harmony/default-parameters-debug.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698