summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/generators/cptn-decl.js
blob: 8b370933a913b87afb5b44b0ebe097be4e73937f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Copyright (C) 2017 Apple Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-statement-semantics-runtime-semantics-evaluation
description: Generator declaration completion value is empty.
info: |
    GeneratorDeclaration[Yield, Await, Default]:

        function * BindingIdentifier[?Yield, ?Await] ( FormalParameters[+Yield, ~Await] ) { GeneratorBody }

    HoistableDeclaration : GeneratorDeclaration

    1. Return NormalCompletion(empty).
features: [generators]
---*/

assert.sameValue(eval('function* f() {}'), undefined);
assert.sameValue(eval('1; function* f() {}'), 1);

reportCompare(0, 0);