| // Copyright (C) 2016 the V8 project authors. All rights reserved. |
| // This code is governed by the BSD license found in the LICENSE file. |
| /*--- |
| desc: Use of initializer when argument value is `undefined` |
| template: default |
| info: | |
| 14.1.19 Runtime Semantics: IteratorBindingInitialization |
| |
| FormalsList : FormalsList , FormalParameter |
| |
| [...] |
| 23. Let iteratorRecord be Record {[[Iterator]]: |
| CreateListIterator(argumentsList), [[Done]]: false}. |
| 24. If hasDuplicates is true, then |
| [...] |
| 25. Else, |
| a. Perform ? IteratorBindingInitialization for formals with |
| iteratorRecord and env as arguments. |
| [...] |
| features: [default-parameters] |
| ---*/ |
| |
| //- params |
| fromLiteral = 23, fromExpr = 45, fromHole = 99 |
| //- args |
| undefined, void 0 |
| //- body |
| assert.sameValue(fromLiteral, 23); |
| assert.sameValue(fromExpr, 45); |
| assert.sameValue(fromHole, 99); |