MCPcopy Create free account
hub / github.com/microsoft/tslib / __generator

Function __generator

tslib.es6.js:125–151  ·  view source on GitHub ↗
(thisArg, body)

Source from the content-addressed store, hash-verified

123}
124
125export function __generator(thisArg, body) {
126 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
127 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
128 function verb(n) { return function (v) { return step([n, v]); }; }
129 function step(op) {
130 if (f) throw new TypeError("Generator is already executing.");
131 while (g && (g = 0, op[0] && (_ = 0)), _) try {
132 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
133 if (y = 0, t) op = [op[0] & 2, t.value];
134 switch (op[0]) {
135 case 0: case 1: t = op; break;
136 case 4: _.label++; return { value: op[1], done: false };
137 case 5: _.label++; y = op[1]; op = [0]; continue;
138 case 7: op = _.ops.pop(); _.trys.pop(); continue;
139 default:
140 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
141 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
142 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
143 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
144 if (t[2]) _.ops.pop();
145 _.trys.pop(); continue;
146 }
147 op = body.call(thisArg, _);
148 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
149 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
150 }
151}
152
153export var __createBinding = Object.create ? (function(o, m, k, k2) {
154 if (k2 === undefined) k2 = k;

Callers

nothing calls this directly

Calls 1

verbFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…