runtime.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. /**
  2. * Copyright (c) 2014-present, Facebook, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. !(function(global) {
  8. "use strict";
  9. var Op = Object.prototype;
  10. var hasOwn = Op.hasOwnProperty;
  11. var undefined; // More compressible than void 0.
  12. var $Symbol = typeof Symbol === "function" ? Symbol : {};
  13. var iteratorSymbol = $Symbol.iterator || "@@iterator";
  14. var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
  15. var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  16. var inModule = typeof module === "object";
  17. var runtime = global.regeneratorRuntime;
  18. if (runtime) {
  19. if (inModule) {
  20. // If regeneratorRuntime is defined globally and we're in a module,
  21. // make the exports object identical to regeneratorRuntime.
  22. module.exports = runtime;
  23. }
  24. // Don't bother evaluating the rest of this file if the runtime was
  25. // already defined globally.
  26. return;
  27. }
  28. // Define the runtime globally (as expected by generated code) as either
  29. // module.exports (if we're in a module) or a new, empty object.
  30. runtime = global.regeneratorRuntime = inModule ? module.exports : {};
  31. function wrap(innerFn, outerFn, self, tryLocsList) {
  32. // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
  33. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
  34. var generator = Object.create(protoGenerator.prototype);
  35. var context = new Context(tryLocsList || []);
  36. // The ._invoke method unifies the implementations of the .next,
  37. // .throw, and .return methods.
  38. generator._invoke = makeInvokeMethod(innerFn, self, context);
  39. return generator;
  40. }
  41. runtime.wrap = wrap;
  42. // Try/catch helper to minimize deoptimizations. Returns a completion
  43. // record like context.tryEntries[i].completion. This interface could
  44. // have been (and was previously) designed to take a closure to be
  45. // invoked without arguments, but in all the cases we care about we
  46. // already have an existing method we want to call, so there's no need
  47. // to create a new function object. We can even get away with assuming
  48. // the method takes exactly one argument, since that happens to be true
  49. // in every case, so we don't have to touch the arguments object. The
  50. // only additional allocation required is the completion record, which
  51. // has a stable shape and so hopefully should be cheap to allocate.
  52. function tryCatch(fn, obj, arg) {
  53. try {
  54. return { type: "normal", arg: fn.call(obj, arg) };
  55. } catch (err) {
  56. return { type: "throw", arg: err };
  57. }
  58. }
  59. var GenStateSuspendedStart = "suspendedStart";
  60. var GenStateSuspendedYield = "suspendedYield";
  61. var GenStateExecuting = "executing";
  62. var GenStateCompleted = "completed";
  63. // Returning this object from the innerFn has the same effect as
  64. // breaking out of the dispatch switch statement.
  65. var ContinueSentinel = {};
  66. // Dummy constructor functions that we use as the .constructor and
  67. // .constructor.prototype properties for functions that return Generator
  68. // objects. For full spec compliance, you may wish to configure your
  69. // minifier not to mangle the names of these two functions.
  70. function Generator() {}
  71. function GeneratorFunction() {}
  72. function GeneratorFunctionPrototype() {}
  73. // This is a polyfill for %IteratorPrototype% for environments that
  74. // don't natively support it.
  75. var IteratorPrototype = {};
  76. IteratorPrototype[iteratorSymbol] = function () {
  77. return this;
  78. };
  79. var getProto = Object.getPrototypeOf;
  80. var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  81. if (NativeIteratorPrototype &&
  82. NativeIteratorPrototype !== Op &&
  83. hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
  84. // This environment has a native %IteratorPrototype%; use it instead
  85. // of the polyfill.
  86. IteratorPrototype = NativeIteratorPrototype;
  87. }
  88. var Gp = GeneratorFunctionPrototype.prototype =
  89. Generator.prototype = Object.create(IteratorPrototype);
  90. GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;
  91. GeneratorFunctionPrototype.constructor = GeneratorFunction;
  92. GeneratorFunctionPrototype[toStringTagSymbol] =
  93. GeneratorFunction.displayName = "GeneratorFunction";
  94. // Helper for defining the .next, .throw, and .return methods of the
  95. // Iterator interface in terms of a single ._invoke method.
  96. function defineIteratorMethods(prototype) {
  97. ["next", "throw", "return"].forEach(function(method) {
  98. prototype[method] = function(arg) {
  99. return this._invoke(method, arg);
  100. };
  101. });
  102. }
  103. runtime.isGeneratorFunction = function(genFun) {
  104. var ctor = typeof genFun === "function" && genFun.constructor;
  105. return ctor
  106. ? ctor === GeneratorFunction ||
  107. // For the native GeneratorFunction constructor, the best we can
  108. // do is to check its .name property.
  109. (ctor.displayName || ctor.name) === "GeneratorFunction"
  110. : false;
  111. };
  112. runtime.mark = function(genFun) {
  113. if (Object.setPrototypeOf) {
  114. Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
  115. } else {
  116. genFun.__proto__ = GeneratorFunctionPrototype;
  117. if (!(toStringTagSymbol in genFun)) {
  118. genFun[toStringTagSymbol] = "GeneratorFunction";
  119. }
  120. }
  121. genFun.prototype = Object.create(Gp);
  122. return genFun;
  123. };
  124. // Within the body of any async function, `await x` is transformed to
  125. // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
  126. // `hasOwn.call(value, "__await")` to determine if the yielded value is
  127. // meant to be awaited.
  128. runtime.awrap = function(arg) {
  129. return { __await: arg };
  130. };
  131. function AsyncIterator(generator) {
  132. function invoke(method, arg, resolve, reject) {
  133. var record = tryCatch(generator[method], generator, arg);
  134. if (record.type === "throw") {
  135. reject(record.arg);
  136. } else {
  137. var result = record.arg;
  138. var value = result.value;
  139. if (value &&
  140. typeof value === "object" &&
  141. hasOwn.call(value, "__await")) {
  142. return Promise.resolve(value.__await).then(function(value) {
  143. invoke("next", value, resolve, reject);
  144. }, function(err) {
  145. invoke("throw", err, resolve, reject);
  146. });
  147. }
  148. return Promise.resolve(value).then(function(unwrapped) {
  149. // When a yielded Promise is resolved, its final value becomes
  150. // the .value of the Promise<{value,done}> result for the
  151. // current iteration. If the Promise is rejected, however, the
  152. // result for this iteration will be rejected with the same
  153. // reason. Note that rejections of yielded Promises are not
  154. // thrown back into the generator function, as is the case
  155. // when an awaited Promise is rejected. This difference in
  156. // behavior between yield and await is important, because it
  157. // allows the consumer to decide what to do with the yielded
  158. // rejection (swallow it and continue, manually .throw it back
  159. // into the generator, abandon iteration, whatever). With
  160. // await, by contrast, there is no opportunity to examine the
  161. // rejection reason outside the generator function, so the
  162. // only option is to throw it from the await expression, and
  163. // let the generator function handle the exception.
  164. result.value = unwrapped;
  165. resolve(result);
  166. }, reject);
  167. }
  168. }
  169. var previousPromise;
  170. function enqueue(method, arg) {
  171. function callInvokeWithMethodAndArg() {
  172. return new Promise(function(resolve, reject) {
  173. invoke(method, arg, resolve, reject);
  174. });
  175. }
  176. return previousPromise =
  177. // If enqueue has been called before, then we want to wait until
  178. // all previous Promises have been resolved before calling invoke,
  179. // so that results are always delivered in the correct order. If
  180. // enqueue has not been called before, then it is important to
  181. // call invoke immediately, without waiting on a callback to fire,
  182. // so that the async generator function has the opportunity to do
  183. // any necessary setup in a predictable way. This predictability
  184. // is why the Promise constructor synchronously invokes its
  185. // executor callback, and why async functions synchronously
  186. // execute code before the first await. Since we implement simple
  187. // async functions in terms of async generators, it is especially
  188. // important to get this right, even though it requires care.
  189. previousPromise ? previousPromise.then(
  190. callInvokeWithMethodAndArg,
  191. // Avoid propagating failures to Promises returned by later
  192. // invocations of the iterator.
  193. callInvokeWithMethodAndArg
  194. ) : callInvokeWithMethodAndArg();
  195. }
  196. // Define the unified helper method that is used to implement .next,
  197. // .throw, and .return (see defineIteratorMethods).
  198. this._invoke = enqueue;
  199. }
  200. defineIteratorMethods(AsyncIterator.prototype);
  201. AsyncIterator.prototype[asyncIteratorSymbol] = function () {
  202. return this;
  203. };
  204. runtime.AsyncIterator = AsyncIterator;
  205. // Note that simple async functions are implemented on top of
  206. // AsyncIterator objects; they just return a Promise for the value of
  207. // the final result produced by the iterator.
  208. runtime.async = function(innerFn, outerFn, self, tryLocsList) {
  209. var iter = new AsyncIterator(
  210. wrap(innerFn, outerFn, self, tryLocsList)
  211. );
  212. return runtime.isGeneratorFunction(outerFn)
  213. ? iter // If outerFn is a generator, return the full iterator.
  214. : iter.next().then(function(result) {
  215. return result.done ? result.value : iter.next();
  216. });
  217. };
  218. function makeInvokeMethod(innerFn, self, context) {
  219. var state = GenStateSuspendedStart;
  220. return function invoke(method, arg) {
  221. if (state === GenStateExecuting) {
  222. throw new Error("Generator is already running");
  223. }
  224. if (state === GenStateCompleted) {
  225. if (method === "throw") {
  226. throw arg;
  227. }
  228. // Be forgiving, per 25.3.3.3.3 of the spec:
  229. // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
  230. return doneResult();
  231. }
  232. context.method = method;
  233. context.arg = arg;
  234. while (true) {
  235. var delegate = context.delegate;
  236. if (delegate) {
  237. var delegateResult = maybeInvokeDelegate(delegate, context);
  238. if (delegateResult) {
  239. if (delegateResult === ContinueSentinel) continue;
  240. return delegateResult;
  241. }
  242. }
  243. if (context.method === "next") {
  244. // Setting context._sent for legacy support of Babel's
  245. // function.sent implementation.
  246. context.sent = context._sent = context.arg;
  247. } else if (context.method === "throw") {
  248. if (state === GenStateSuspendedStart) {
  249. state = GenStateCompleted;
  250. throw context.arg;
  251. }
  252. context.dispatchException(context.arg);
  253. } else if (context.method === "return") {
  254. context.abrupt("return", context.arg);
  255. }
  256. state = GenStateExecuting;
  257. var record = tryCatch(innerFn, self, context);
  258. if (record.type === "normal") {
  259. // If an exception is thrown from innerFn, we leave state ===
  260. // GenStateExecuting and loop back for another invocation.
  261. state = context.done
  262. ? GenStateCompleted
  263. : GenStateSuspendedYield;
  264. if (record.arg === ContinueSentinel) {
  265. continue;
  266. }
  267. return {
  268. value: record.arg,
  269. done: context.done
  270. };
  271. } else if (record.type === "throw") {
  272. state = GenStateCompleted;
  273. // Dispatch the exception by looping back around to the
  274. // context.dispatchException(context.arg) call above.
  275. context.method = "throw";
  276. context.arg = record.arg;
  277. }
  278. }
  279. };
  280. }
  281. // Call delegate.iterator[context.method](context.arg) and handle the
  282. // result, either by returning a { value, done } result from the
  283. // delegate iterator, or by modifying context.method and context.arg,
  284. // setting context.delegate to null, and returning the ContinueSentinel.
  285. function maybeInvokeDelegate(delegate, context) {
  286. var method = delegate.iterator[context.method];
  287. if (method === undefined) {
  288. // A .throw or .return when the delegate iterator has no .throw
  289. // method always terminates the yield* loop.
  290. context.delegate = null;
  291. if (context.method === "throw") {
  292. if (delegate.iterator.return) {
  293. // If the delegate iterator has a return method, give it a
  294. // chance to clean up.
  295. context.method = "return";
  296. context.arg = undefined;
  297. maybeInvokeDelegate(delegate, context);
  298. if (context.method === "throw") {
  299. // If maybeInvokeDelegate(context) changed context.method from
  300. // "return" to "throw", let that override the TypeError below.
  301. return ContinueSentinel;
  302. }
  303. }
  304. context.method = "throw";
  305. context.arg = new TypeError(
  306. "The iterator does not provide a 'throw' method");
  307. }
  308. return ContinueSentinel;
  309. }
  310. var record = tryCatch(method, delegate.iterator, context.arg);
  311. if (record.type === "throw") {
  312. context.method = "throw";
  313. context.arg = record.arg;
  314. context.delegate = null;
  315. return ContinueSentinel;
  316. }
  317. var info = record.arg;
  318. if (! info) {
  319. context.method = "throw";
  320. context.arg = new TypeError("iterator result is not an object");
  321. context.delegate = null;
  322. return ContinueSentinel;
  323. }
  324. if (info.done) {
  325. // Assign the result of the finished delegate to the temporary
  326. // variable specified by delegate.resultName (see delegateYield).
  327. context[delegate.resultName] = info.value;
  328. // Resume execution at the desired location (see delegateYield).
  329. context.next = delegate.nextLoc;
  330. // If context.method was "throw" but the delegate handled the
  331. // exception, let the outer generator proceed normally. If
  332. // context.method was "next", forget context.arg since it has been
  333. // "consumed" by the delegate iterator. If context.method was
  334. // "return", allow the original .return call to continue in the
  335. // outer generator.
  336. if (context.method !== "return") {
  337. context.method = "next";
  338. context.arg = undefined;
  339. }
  340. } else {
  341. // Re-yield the result returned by the delegate method.
  342. return info;
  343. }
  344. // The delegate iterator is finished, so forget it and continue with
  345. // the outer generator.
  346. context.delegate = null;
  347. return ContinueSentinel;
  348. }
  349. // Define Generator.prototype.{next,throw,return} in terms of the
  350. // unified ._invoke helper method.
  351. defineIteratorMethods(Gp);
  352. Gp[toStringTagSymbol] = "Generator";
  353. // A Generator should always return itself as the iterator object when the
  354. // @@iterator function is called on it. Some browsers' implementations of the
  355. // iterator prototype chain incorrectly implement this, causing the Generator
  356. // object to not be returned from this call. This ensures that doesn't happen.
  357. // See https://github.com/facebook/regenerator/issues/274 for more details.
  358. Gp[iteratorSymbol] = function() {
  359. return this;
  360. };
  361. Gp.toString = function() {
  362. return "[object Generator]";
  363. };
  364. function pushTryEntry(locs) {
  365. var entry = { tryLoc: locs[0] };
  366. if (1 in locs) {
  367. entry.catchLoc = locs[1];
  368. }
  369. if (2 in locs) {
  370. entry.finallyLoc = locs[2];
  371. entry.afterLoc = locs[3];
  372. }
  373. this.tryEntries.push(entry);
  374. }
  375. function resetTryEntry(entry) {
  376. var record = entry.completion || {};
  377. record.type = "normal";
  378. delete record.arg;
  379. entry.completion = record;
  380. }
  381. function Context(tryLocsList) {
  382. // The root entry object (effectively a try statement without a catch
  383. // or a finally block) gives us a place to store values thrown from
  384. // locations where there is no enclosing try statement.
  385. this.tryEntries = [{ tryLoc: "root" }];
  386. tryLocsList.forEach(pushTryEntry, this);
  387. this.reset(true);
  388. }
  389. runtime.keys = function(object) {
  390. var keys = [];
  391. for (var key in object) {
  392. keys.push(key);
  393. }
  394. keys.reverse();
  395. // Rather than returning an object with a next method, we keep
  396. // things simple and return the next function itself.
  397. return function next() {
  398. while (keys.length) {
  399. var key = keys.pop();
  400. if (key in object) {
  401. next.value = key;
  402. next.done = false;
  403. return next;
  404. }
  405. }
  406. // To avoid creating an additional object, we just hang the .value
  407. // and .done properties off the next function object itself. This
  408. // also ensures that the minifier will not anonymize the function.
  409. next.done = true;
  410. return next;
  411. };
  412. };
  413. function values(iterable) {
  414. if (iterable) {
  415. var iteratorMethod = iterable[iteratorSymbol];
  416. if (iteratorMethod) {
  417. return iteratorMethod.call(iterable);
  418. }
  419. if (typeof iterable.next === "function") {
  420. return iterable;
  421. }
  422. if (!isNaN(iterable.length)) {
  423. var i = -1, next = function next() {
  424. while (++i < iterable.length) {
  425. if (hasOwn.call(iterable, i)) {
  426. next.value = iterable[i];
  427. next.done = false;
  428. return next;
  429. }
  430. }
  431. next.value = undefined;
  432. next.done = true;
  433. return next;
  434. };
  435. return next.next = next;
  436. }
  437. }
  438. // Return an iterator with no values.
  439. return { next: doneResult };
  440. }
  441. runtime.values = values;
  442. function doneResult() {
  443. return { value: undefined, done: true };
  444. }
  445. Context.prototype = {
  446. constructor: Context,
  447. reset: function(skipTempReset) {
  448. this.prev = 0;
  449. this.next = 0;
  450. // Resetting context._sent for legacy support of Babel's
  451. // function.sent implementation.
  452. this.sent = this._sent = undefined;
  453. this.done = false;
  454. this.delegate = null;
  455. this.method = "next";
  456. this.arg = undefined;
  457. this.tryEntries.forEach(resetTryEntry);
  458. if (!skipTempReset) {
  459. for (var name in this) {
  460. // Not sure about the optimal order of these conditions:
  461. if (name.charAt(0) === "t" &&
  462. hasOwn.call(this, name) &&
  463. !isNaN(+name.slice(1))) {
  464. this[name] = undefined;
  465. }
  466. }
  467. }
  468. },
  469. stop: function() {
  470. this.done = true;
  471. var rootEntry = this.tryEntries[0];
  472. var rootRecord = rootEntry.completion;
  473. if (rootRecord.type === "throw") {
  474. throw rootRecord.arg;
  475. }
  476. return this.rval;
  477. },
  478. dispatchException: function(exception) {
  479. if (this.done) {
  480. throw exception;
  481. }
  482. var context = this;
  483. function handle(loc, caught) {
  484. record.type = "throw";
  485. record.arg = exception;
  486. context.next = loc;
  487. if (caught) {
  488. // If the dispatched exception was caught by a catch block,
  489. // then let that catch block handle the exception normally.
  490. context.method = "next";
  491. context.arg = undefined;
  492. }
  493. return !! caught;
  494. }
  495. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  496. var entry = this.tryEntries[i];
  497. var record = entry.completion;
  498. if (entry.tryLoc === "root") {
  499. // Exception thrown outside of any try block that could handle
  500. // it, so set the completion value of the entire function to
  501. // throw the exception.
  502. return handle("end");
  503. }
  504. if (entry.tryLoc <= this.prev) {
  505. var hasCatch = hasOwn.call(entry, "catchLoc");
  506. var hasFinally = hasOwn.call(entry, "finallyLoc");
  507. if (hasCatch && hasFinally) {
  508. if (this.prev < entry.catchLoc) {
  509. return handle(entry.catchLoc, true);
  510. } else if (this.prev < entry.finallyLoc) {
  511. return handle(entry.finallyLoc);
  512. }
  513. } else if (hasCatch) {
  514. if (this.prev < entry.catchLoc) {
  515. return handle(entry.catchLoc, true);
  516. }
  517. } else if (hasFinally) {
  518. if (this.prev < entry.finallyLoc) {
  519. return handle(entry.finallyLoc);
  520. }
  521. } else {
  522. throw new Error("try statement without catch or finally");
  523. }
  524. }
  525. }
  526. },
  527. abrupt: function(type, arg) {
  528. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  529. var entry = this.tryEntries[i];
  530. if (entry.tryLoc <= this.prev &&
  531. hasOwn.call(entry, "finallyLoc") &&
  532. this.prev < entry.finallyLoc) {
  533. var finallyEntry = entry;
  534. break;
  535. }
  536. }
  537. if (finallyEntry &&
  538. (type === "break" ||
  539. type === "continue") &&
  540. finallyEntry.tryLoc <= arg &&
  541. arg <= finallyEntry.finallyLoc) {
  542. // Ignore the finally entry if control is not jumping to a
  543. // location outside the try/catch block.
  544. finallyEntry = null;
  545. }
  546. var record = finallyEntry ? finallyEntry.completion : {};
  547. record.type = type;
  548. record.arg = arg;
  549. if (finallyEntry) {
  550. this.method = "next";
  551. this.next = finallyEntry.finallyLoc;
  552. return ContinueSentinel;
  553. }
  554. return this.complete(record);
  555. },
  556. complete: function(record, afterLoc) {
  557. if (record.type === "throw") {
  558. throw record.arg;
  559. }
  560. if (record.type === "break" ||
  561. record.type === "continue") {
  562. this.next = record.arg;
  563. } else if (record.type === "return") {
  564. this.rval = this.arg = record.arg;
  565. this.method = "return";
  566. this.next = "end";
  567. } else if (record.type === "normal" && afterLoc) {
  568. this.next = afterLoc;
  569. }
  570. return ContinueSentinel;
  571. },
  572. finish: function(finallyLoc) {
  573. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  574. var entry = this.tryEntries[i];
  575. if (entry.finallyLoc === finallyLoc) {
  576. this.complete(entry.completion, entry.afterLoc);
  577. resetTryEntry(entry);
  578. return ContinueSentinel;
  579. }
  580. }
  581. },
  582. "catch": function(tryLoc) {
  583. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  584. var entry = this.tryEntries[i];
  585. if (entry.tryLoc === tryLoc) {
  586. var record = entry.completion;
  587. if (record.type === "throw") {
  588. var thrown = record.arg;
  589. resetTryEntry(entry);
  590. }
  591. return thrown;
  592. }
  593. }
  594. // The context.catch method must only be called with a location
  595. // argument that corresponds to a known catch block.
  596. throw new Error("illegal catch attempt");
  597. },
  598. delegateYield: function(iterable, resultName, nextLoc) {
  599. this.delegate = {
  600. iterator: values(iterable),
  601. resultName: resultName,
  602. nextLoc: nextLoc
  603. };
  604. if (this.method === "next") {
  605. // Deliberately forget the last sent value so that we don't
  606. // accidentally pass it on to the delegate.
  607. this.arg = undefined;
  608. }
  609. return ContinueSentinel;
  610. }
  611. };
  612. })(
  613. // In sloppy mode, unbound `this` refers to the global object, fallback to
  614. // Function constructor if we're in global strict mode. That is sadly a form
  615. // of indirect eval which violates Content Security Policy.
  616. (function() { return this })() || Function("return this")()
  617. );