summaryrefslogtreecommitdiff
path: root/src/function-forms/dflt-params-arg-val-undefined.case
blob: f1396d31fb8fecbd54f630411ee0797292e9593d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// 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 intializer 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);