Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bens root removal service #3402

Merged
merged 4 commits into from Mar 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/internal/observable/dom/WebSocketSubject.ts
Expand Up @@ -3,7 +3,6 @@ import { Subscriber } from '../../Subscriber';
import { Observable } from '../../Observable';
import { Subscription } from '../../Subscription';
import { Operator } from '../../Operator';
import { root } from '../..//util/root';
import { ReplaySubject } from '../../ReplaySubject';
import { Observer, NextObserver } from '../../types';
import { tryCatch } from '../..//util/tryCatch';
Expand Down Expand Up @@ -90,7 +89,7 @@ export class WebSocketSubject<T> extends AnonymousSubject<T> {
super(destination, <Observable<T>> urlConfigOrSource);
} else {
super();
this.WebSocketCtor = root.WebSocket;
this.WebSocketCtor = WebSocket;
this._output = new Subject<T>();
if (typeof urlConfigOrSource === 'string') {
this.url = urlConfigOrSource;
Expand Down
5 changes: 2 additions & 3 deletions src/internal/scheduler/AsyncAction.ts
@@ -1,4 +1,3 @@
import { root } from '../util/root';
import { Action } from './Action';
import { Subscription } from '../Subscription';
import { AsyncScheduler } from './AsyncScheduler';
Expand Down Expand Up @@ -69,7 +68,7 @@ export class AsyncAction<T> extends Action<T> {
}

protected requestAsyncId(scheduler: AsyncScheduler, id?: any, delay: number = 0): any {
return root.setInterval(scheduler.flush.bind(scheduler, this), delay);
return setInterval(scheduler.flush.bind(scheduler, this), delay);
}

protected recycleAsyncId(scheduler: AsyncScheduler, id: any, delay: number = 0): any {
Expand All @@ -79,7 +78,7 @@ export class AsyncAction<T> extends Action<T> {
}
// Otherwise, if the action's delay time is different from the current delay,
// or the action has been rescheduled before it's executed, clear the interval id
return root.clearInterval(id) && undefined || undefined;
return clearInterval(id) && undefined || undefined;
}

/**
Expand Down
10 changes: 4 additions & 6 deletions src/internal/symbol/rxSubscriber.ts
@@ -1,9 +1,7 @@
import { root } from '../util/root';

const Symbol: any = root.Symbol;

export const rxSubscriber = (typeof Symbol === 'function' && typeof Symbol.for === 'function') ?
Symbol.for('rxSubscriber') : '@@rxSubscriber';
export const rxSubscriber =
(typeof Symbol === 'function' && typeof Symbol.for === 'function')
? Symbol.for('rxSubscriber')
: '@@rxSubscriber';

/**
* @deprecated use rxSubscriber instead
Expand Down
3 changes: 1 addition & 2 deletions src/internal/util/subscribeToPromise.ts
@@ -1,4 +1,3 @@
import { root } from './root';
import { Subscriber } from '../Subscriber';

export const subscribeToPromise = <T>(promise: PromiseLike<T>) => (subscriber: Subscriber<T>) => {
Expand All @@ -13,7 +12,7 @@ export const subscribeToPromise = <T>(promise: PromiseLike<T>) => (subscriber: S
)
.then(null, (err: any) => {
// Escaping the Promise trap: globally throw unhandled errors
root.setTimeout(() => { throw err; });
setTimeout(() => { throw err; });
});
return subscriber;
};