test262/test/language/expressions/generators/yield-identifier-spread-strict.js
Leo Balter b3092c61b6 Add generators flags for tests depending on generators features (#1259)
* Add missing generators feature flags

* Generate files

* Add generators flags

* fixup! Add generators flags
2017-10-04 16:12:34 -04:00

45 lines
1.0 KiB
JavaScript

// This file was procedurally generated from the following sources:
// - src/generators/yield-identifier-spread-strict.case
// - src/generators/default/expression.template
/*---
description: It's an early error if the AssignmentExpression is a function body with yield as an identifier in strict mode. (Unnamed generator expression)
esid: prod-GeneratorExpression
features: [object-spread, generators]
flags: [generated, onlyStrict]
negative:
phase: early
type: SyntaxError
info: |
14.4 Generator Function Definitions
GeneratorExpression:
function * BindingIdentifier opt ( FormalParameters ) { GeneratorBody }
Spread Properties
PropertyDefinition[Yield]:
(...)
...AssignmentExpression[In, ?Yield]
---*/
throw "Test262: This statement should not be evaluated.";
var callCount = 0;
var gen = function *() {
callCount += 1;
return {
...(function() {
var yield;
throw new Test262Error();
}()),
}
};
var iter = gen();
assert.sameValue(callCount, 1);