summaryrefslogtreecommitdiff
path: root/src/dstr-binding/obj-ptrn-prop-id-init-throws.case
blob: e878fc6f3a8a3c3106288926c54a941df03433fe (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
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
template: error
desc: Error thrown when evaluating the initializer
info: |
    13.3.3.7 Runtime Semantics: KeyedBindingInitialization

    BindingElement : BindingPattern Initializeropt

    [...]
    3. If Initializer is present and v is undefined, then
       a. Let defaultValue be the result of evaluating Initializer.
       b. Let v be GetValue(defaultValue).
       c. ReturnIfAbrupt(v).
---*/

//- setup
function thrower() {
  throw new Test262Error();
}
//- elems
{ x: y = thrower() }
//- vals
{}
//- error
Test262Error