mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
26 lines
795 B
Plaintext
26 lines
795 B
Plaintext
// Copyright (C) 2017 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
path: language/arguments-object/gen-func-decl-
|
|
name: generator function declaration
|
|
esid: sec-arguments-exotic-objects
|
|
info: |
|
|
9.4.4 Arguments Exotic Objects
|
|
|
|
Most ECMAScript functions make an arguments object available to their code. Depending upon the
|
|
characteristics of the function definition, its arguments object is either an ordinary object
|
|
or an arguments exotic object.
|
|
---*/
|
|
|
|
var callCount = 0;
|
|
// Stores a reference `ref` for case evaluation
|
|
function* ref(/*{ params }*/) {
|
|
/*{ body }*/
|
|
callCount = callCount + 1;
|
|
}
|
|
|
|
ref(/*{ args }*/).next();
|
|
|
|
assert.sameValue(callCount, 1, 'generator function invoked exactly once');
|