test262/test/language/expressions/async-generator/dstr-named-dflt-obj-ptrn-pr...

45 lines
1.4 KiB
JavaScript
Raw Normal View History

2017-03-20 18:30:18 +01:00
// This file was procedurally generated from the following sources:
// - src/dstr-binding/obj-ptrn-prop-id-init-unresolvable.case
// - src/dstr-binding/error/async-gen-func-named-expr-dflt.template
/*---
description: Destructuring initializer is an unresolvable reference (async generator named function expression (default parameter))
esid: sec-asyncgenerator-definitions-evaluation
features: [async-iteration]
flags: [generated]
info: |
AsyncGeneratorExpression : async [no LineTerminator here] function * BindingIdentifier
( FormalParameters ) { AsyncGeneratorBody }
[...]
7. Let closure be ! AsyncGeneratorFunctionCreate(Normal, FormalParameters,
AsyncGeneratorBody, funcEnv, strict).
[...]
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).
6.2.3.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.
---*/
var f;
2017-04-06 23:52:56 +02:00
f = async function* h({ x: y = unresolvableReference } = {}) {
2017-03-20 18:30:18 +01:00
};
assert.throws(ReferenceError, function() {
f();
});