aboutsummaryrefslogtreecommitdiffstats
path: root/src/async-generators/yield-identifier-non-strict.case
blob: ebbcb1add8364e29afdcea5f96912ac46c27dce8 (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) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
desc: >
  Use of yield as a valid identifier in a function body inside a generator body
  in non strict mode
template: non-strict
flags: [noStrict, async]
---*/

//- body
  return (function(arg) {
    var yield = arg + 1;
    return yield;
  }(yield))
//- assertions
var item = iter.next();

item.then(({ done, value }) => {
  assert.sameValue(done, false);
  assert.sameValue(value, undefined);
});

item = iter.next(42);

item.then(({ done, value }) => {
  assert.sameValue(done, true);
  assert.sameValue(value, 43);
}).then($DONE, $DONE);