MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / generatorResult

Function generatorResult

lib/web/tern/infer.js:1806–1814  ·  view source on GitHub ↗
(input, output)

Source from the content-addressed store, hash-verified

1804 }
1805
1806 function generatorResult(input, output) {
1807 var retObj = new Obj(true)
1808 retObj.defProp("done").addType(cx.bool)
1809 output.propagate(retObj.defProp("value"))
1810 var method = new Fn(null, ANull, input ? [input] : [], input ? ["?"] : [], retObj)
1811 var result = new Obj(cx.definitions.ecmascript && cx.definitions.ecmascript.generator_prototype || true)
1812 result.defProp("next").addType(method)
1813 return result
1814 }
1815
1816 function maybeIterator(fn, output) {
1817 if (!fn.generator) return output

Callers 1

maybeIteratorFunction · 0.85

Calls 1

propagateMethod · 0.80

Tested by

no test coverage detected