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

Unified Diff: test/mjsunit/harmony/default-parameters-lazy.js

Issue 1127063003: [es6] implement default parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase + rossberg nits Created 5 years, 7 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
« no previous file with comments | « 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/default-parameters-lazy.js
diff --git a/test/mjsunit/harmony/default-parameters-lazy.js b/test/mjsunit/harmony/default-parameters-lazy.js
new file mode 100644
index 0000000000000000000000000000000000000000..3637a0f1d215dfa694766378efa738cceac95d97
--- /dev/null
+++ b/test/mjsunit/harmony/default-parameters-lazy.js
@@ -0,0 +1,22 @@
+// Copyright 2015 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony-default-parameters --min-preparse-length=0
+
+var i = 0;
+function f(handler = function(b) { return b + "#" + (++i); }, b = "red") {
+ return handler(b);
+}
+
+assertEquals([
+ "blue#1",
+ "red#2",
+ "red",
+ "yellow#3"
+], [
+ f(undefined, "blue"),
+ f(),
+ f(function(b) { return b; }),
+ f(undefined, "yellow")
+]);
« no previous file with comments | « 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