Revision control

Copy as Markdown

// Copyright (C) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
desc: Destructuring initializer is an unresolvable reference
template: error
info: |
13.3.3.7 Runtime Semantics: KeyedBindingInitialization
BindingElement : BindingPattern Initializer_opt
[...]
4. If Initializer is present and v is undefined, then
a. Let defaultValue be the result of evaluating Initializer.
b. Set v to ? GetValue(defaultValue).
6.2.4.1 GetValue ( V )
1. ReturnIfAbrupt(V).
2. If Type(V) is not Reference, return V.
3. Let base be GetBase(V).
4. If IsUnresolvableReference(V), throw a ReferenceError exception.
---*/
//- elems
{ x: y = unresolvableReference }
//- vals
{}
//- error
ReferenceError