| 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..d8ff0cbcb7046950477aa26ac462c8a1ec67d26b
|
| --- /dev/null
|
| +++ b/test/mjsunit/harmony/default-parameters-lazy.js
|
| @@ -0,0 +1,69 @@
|
| +// 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 --harmony-arrow-functions
|
| +
|
| +/* ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + * ............................................................................
|
| + */
|
| +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")
|
| +]);
|
|
|