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") |
+]); |