mirror of
https://github.com/tc39/test262.git
synced 2025-09-26 11:38:50 +02:00
31 lines
830 B
Plaintext
31 lines
830 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-meth-
|
|
name: generator method
|
|
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.
|
|
features: [generators]
|
|
---*/
|
|
|
|
var callCount = 0;
|
|
var obj = {
|
|
*method() {
|
|
/*{ body }*/
|
|
callCount = callCount + 1;
|
|
}
|
|
};
|
|
|
|
obj.method(/*{ args }*/).next();
|
|
|
|
// Stores a reference `ref` for case evaluation
|
|
var ref = obj.method;
|
|
|
|
assert.sameValue(callCount, 1, 'generator method invoked exactly once');
|