MCPcopy
hub / github.com/spritejs/spritejs / defineIteratorMethods

Function defineIteratorMethods

docs/demo/spritejs.worker.js:10001–10007  ·  view source on GitHub ↗
(prototype)

Source from the content-addressed store, hash-verified

9999 // Helper for defining the .next, .throw, and .return methods of the
10000 // Iterator interface in terms of a single ._invoke method.
10001 function defineIteratorMethods(prototype) {
10002 ["next", "throw", "return"].forEach(function(method) {
10003 define(prototype, method, function(arg) {
10004 return this._invoke(method, arg);
10005 });
10006 });
10007 }
10008
10009 exports.isGeneratorFunction = function(genFun) {
10010 var ctor = typeof genFun === "function" && genFun.constructor;

Callers 1

spritejs.worker.jsFile · 0.70

Calls 1

defineFunction · 0.70

Tested by

no test coverage detected