source: trip-planner-front/node_modules/zone.js/dist/zone-patch-rxjs.js@ ceaed42

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

initial commit

  • Property mode set to 100644
File size: 9.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(function (global, factory) {
8 typeof exports === 'object' && typeof module !== 'undefined' ? factory(require('rxjs')) :
9 typeof define === 'function' && define.amd ? define(['rxjs'], factory) :
10 (global = global || self, factory(global.rxjs));
11}(this, (function (rxjs) {
12 'use strict';
13 /**
14 * @license
15 * Copyright Google LLC All Rights Reserved.
16 *
17 * Use of this source code is governed by an MIT-style license that can be
18 * found in the LICENSE file at https://angular.io/license
19 */
20 Zone.__load_patch('rxjs', function (global, Zone, api) {
21 var symbol = Zone.__symbol__;
22 var nextSource = 'rxjs.Subscriber.next';
23 var errorSource = 'rxjs.Subscriber.error';
24 var completeSource = 'rxjs.Subscriber.complete';
25 var ObjectDefineProperties = Object.defineProperties;
26 var patchObservable = function () {
27 var ObservablePrototype = rxjs.Observable.prototype;
28 var _symbolSubscribe = symbol('_subscribe');
29 var _subscribe = ObservablePrototype[_symbolSubscribe] = ObservablePrototype._subscribe;
30 ObjectDefineProperties(rxjs.Observable.prototype, {
31 _zone: { value: null, writable: true, configurable: true },
32 _zoneSource: { value: null, writable: true, configurable: true },
33 _zoneSubscribe: { value: null, writable: true, configurable: true },
34 source: {
35 configurable: true,
36 get: function () {
37 return this._zoneSource;
38 },
39 set: function (source) {
40 this._zone = Zone.current;
41 this._zoneSource = source;
42 }
43 },
44 _subscribe: {
45 configurable: true,
46 get: function () {
47 if (this._zoneSubscribe) {
48 return this._zoneSubscribe;
49 }
50 else if (this.constructor === rxjs.Observable) {
51 return _subscribe;
52 }
53 var proto = Object.getPrototypeOf(this);
54 return proto && proto._subscribe;
55 },
56 set: function (subscribe) {
57 this._zone = Zone.current;
58 if (!subscribe) {
59 this._zoneSubscribe = subscribe;
60 }
61 else {
62 this._zoneSubscribe = function () {
63 if (this._zone && this._zone !== Zone.current) {
64 var tearDown_1 = this._zone.run(subscribe, this, arguments);
65 if (typeof tearDown_1 === 'function') {
66 var zone_1 = this._zone;
67 return function () {
68 if (zone_1 !== Zone.current) {
69 return zone_1.run(tearDown_1, this, arguments);
70 }
71 return tearDown_1.apply(this, arguments);
72 };
73 }
74 else {
75 return tearDown_1;
76 }
77 }
78 else {
79 return subscribe.apply(this, arguments);
80 }
81 };
82 }
83 }
84 },
85 subjectFactory: {
86 get: function () {
87 return this._zoneSubjectFactory;
88 },
89 set: function (factory) {
90 var zone = this._zone;
91 this._zoneSubjectFactory = function () {
92 if (zone && zone !== Zone.current) {
93 return zone.run(factory, this, arguments);
94 }
95 return factory.apply(this, arguments);
96 };
97 }
98 }
99 });
100 };
101 api.patchMethod(rxjs.Observable.prototype, 'lift', function (delegate) { return function (self, args) {
102 var observable = delegate.apply(self, args);
103 if (observable.operator) {
104 observable.operator._zone = Zone.current;
105 api.patchMethod(observable.operator, 'call', function (operatorDelegate) { return function (operatorSelf, operatorArgs) {
106 if (operatorSelf._zone && operatorSelf._zone !== Zone.current) {
107 return operatorSelf._zone.run(operatorDelegate, operatorSelf, operatorArgs);
108 }
109 return operatorDelegate.apply(operatorSelf, operatorArgs);
110 }; });
111 }
112 return observable;
113 }; });
114 var patchSubscription = function () {
115 ObjectDefineProperties(rxjs.Subscription.prototype, {
116 _zone: { value: null, writable: true, configurable: true },
117 _zoneUnsubscribe: { value: null, writable: true, configurable: true },
118 _unsubscribe: {
119 get: function () {
120 if (this._zoneUnsubscribe || this._zoneUnsubscribeCleared) {
121 return this._zoneUnsubscribe;
122 }
123 var proto = Object.getPrototypeOf(this);
124 return proto && proto._unsubscribe;
125 },
126 set: function (unsubscribe) {
127 this._zone = Zone.current;
128 if (!unsubscribe) {
129 this._zoneUnsubscribe = unsubscribe;
130 // In some operator such as `retryWhen`, the _unsubscribe
131 // method will be set to null, so we need to set another flag
132 // to tell that we should return null instead of finding
133 // in the prototype chain.
134 this._zoneUnsubscribeCleared = true;
135 }
136 else {
137 this._zoneUnsubscribeCleared = false;
138 this._zoneUnsubscribe = function () {
139 if (this._zone && this._zone !== Zone.current) {
140 return this._zone.run(unsubscribe, this, arguments);
141 }
142 else {
143 return unsubscribe.apply(this, arguments);
144 }
145 };
146 }
147 }
148 }
149 });
150 };
151 var patchSubscriber = function () {
152 var next = rxjs.Subscriber.prototype.next;
153 var error = rxjs.Subscriber.prototype.error;
154 var complete = rxjs.Subscriber.prototype.complete;
155 Object.defineProperty(rxjs.Subscriber.prototype, 'destination', {
156 configurable: true,
157 get: function () {
158 return this._zoneDestination;
159 },
160 set: function (destination) {
161 this._zone = Zone.current;
162 this._zoneDestination = destination;
163 }
164 });
165 // patch Subscriber.next to make sure it run
166 // into SubscriptionZone
167 rxjs.Subscriber.prototype.next = function () {
168 var currentZone = Zone.current;
169 var subscriptionZone = this._zone;
170 // for performance concern, check Zone.current
171 // equal with this._zone(SubscriptionZone) or not
172 if (subscriptionZone && subscriptionZone !== currentZone) {
173 return subscriptionZone.run(next, this, arguments, nextSource);
174 }
175 else {
176 return next.apply(this, arguments);
177 }
178 };
179 rxjs.Subscriber.prototype.error = function () {
180 var currentZone = Zone.current;
181 var subscriptionZone = this._zone;
182 // for performance concern, check Zone.current
183 // equal with this._zone(SubscriptionZone) or not
184 if (subscriptionZone && subscriptionZone !== currentZone) {
185 return subscriptionZone.run(error, this, arguments, errorSource);
186 }
187 else {
188 return error.apply(this, arguments);
189 }
190 };
191 rxjs.Subscriber.prototype.complete = function () {
192 var currentZone = Zone.current;
193 var subscriptionZone = this._zone;
194 // for performance concern, check Zone.current
195 // equal with this._zone(SubscriptionZone) or not
196 if (subscriptionZone && subscriptionZone !== currentZone) {
197 return subscriptionZone.run(complete, this, arguments, completeSource);
198 }
199 else {
200 return complete.call(this);
201 }
202 };
203 };
204 patchObservable();
205 patchSubscription();
206 patchSubscriber();
207 });
208})));
Note: See TracBrowser for help on using the repository browser.