(input, output, async)
| 1858 | } |
| 1859 | |
| 1860 | function generatorResult(input, output, async) { |
| 1861 | var defs = cx.definitions.ecmascript; |
| 1862 | var valObj = new Obj(true); |
| 1863 | valObj.defProp("done").addType(cx.bool); |
| 1864 | output.propagate(valObj.defProp("value")); |
| 1865 | var retObj = valObj; |
| 1866 | if (async && defs) { |
| 1867 | retObj = new Obj(defs["Promise.prototype"]); |
| 1868 | retObj.getType().propagate(new DefProp(':t', valObj)); |
| 1869 | } |
| 1870 | var method = new Fn(null, ANull, input ? [input] : [], input ? ["?"] : [], retObj); |
| 1871 | var result = new Obj(defs ? async ? defs.async_generator_prototype : defs.generator_prototype : true); |
| 1872 | result.defProp("next").addType(method); |
| 1873 | return result; |
| 1874 | } |
| 1875 | |
| 1876 | function maybeIterator(fn, output) { |
| 1877 | if (!fn.generator) return output; |
no outgoing calls
no test coverage detected
searching dependent graphs…