source: trip-planner-front/node_modules/zone.js/fesm2015/zone-patch-fetch.min.js@ eed0bf8

Last change on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.6 KB
Line 
1"use strict";
2/**
3 * @license Angular v12.0.0-next.0
4 * (c) 2010-2020 Google LLC. https://angular.io/
5 * License: MIT
6 */
7/**
8 * @license
9 * Copyright Google LLC All Rights Reserved.
10 *
11 * Use of this source code is governed by an MIT-style license that can be
12 * found in the LICENSE file at https://angular.io/license
13 */Zone.__load_patch("fetch",(t,o,e)=>{let n=t.fetch;if("function"!=typeof n)return;const r=t[e.symbol("fetch")];r&&(n=r);const l=t.Promise,c=e.symbol("thenPatched"),a=e.symbol("fetchTaskScheduling"),s=e.symbol("fetchTaskAborting"),f=t.AbortController,i="function"==typeof f;let h=null;i&&(t.AbortController=function(){const t=new f;return t.signal.abortController=t,t},h=e.patchMethod(f.prototype,"abort",t=>(o,e)=>o.task?o.task.zone.cancelTask(o.task):t.apply(o,e)));const u=function(){};t.fetch=function(){const t=Array.prototype.slice.call(arguments),r=t.length>1?t[1]:null,f=r&&r.signal;return new Promise((r,b)=>{const p=o.current.scheduleMacroTask("fetch",u,{fetchArgs:t},()=>{let s,f=o.current;try{f[a]=!0,s=n.apply(this,t)}catch(t){return void b(t)}finally{f[a]=!1}if(!(s instanceof l)){let t=s.constructor;t[c]||e.patchThen(t)}s.then(t=>{"notScheduled"!==p.state&&p.invoke(),r(t)},t=>{"notScheduled"!==p.state&&p.invoke(),b(t)})},()=>{if(i)if(f&&f.abortController&&!f.aborted&&"function"==typeof f.abortController.abort&&h)try{o.current[s]=!0,h.call(f.abortController)}finally{o.current[s]=!1}else b("cancel fetch need a AbortController.signal");else b("No AbortController supported, can not cancel fetch")});f&&f.abortController&&(f.abortController.task=p)})}});
Note: See TracBrowser for help on using the repository browser.