Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit d578883

Browse files
Fixing globals
1 parent 209d6ce commit d578883

77 files changed

Lines changed: 3852 additions & 8959 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/modular/dist/rx.all.js

Lines changed: 1682 additions & 1551 deletions
Large diffs are not rendered by default.

src/modular/dist/rx.all.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modular/dist/rx.js

Lines changed: 0 additions & 5988 deletions
This file was deleted.

src/modular/dist/rx.lite.js

Lines changed: 977 additions & 1038 deletions
Large diffs are not rendered by default.

src/modular/dist/rx.lite.min.js

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/modular/dist/rx.min.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/modular/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ Observable.addToPrototype({
6363
combineLatest: require('./observable/combinelatest'),
6464
concat: require('./observable/concat'),
6565
concatAll: require('./observable/concatall'),
66+
controlled: require('./observable/controlled'),
6667
count: require('./observable/count'),
6768
debounce: require('./observable/debounce'),
6869
defaultIfEmpty: require('./observable/defaultifempty'),
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
'use strict';
22

33
var isFunction = require('../helpers/isfunction');
4-
5-
global._Rx || (global._Rx = {});
6-
var errorObj = global._Rx.errorObj = {e: {}};
4+
var errorObj = module.exports.errorObj = {e: {}};
75

86
function tryCatcherGen(tryCatchTarget) {
97
return function tryCatcher() {
@@ -16,16 +14,11 @@ function tryCatcherGen(tryCatchTarget) {
1614
};
1715
}
1816

19-
function tryCatch(fn) {
17+
module.exports.tryCatch = function tryCatch(fn) {
2018
if (!isFunction(fn)) { throw new TypeError('fn must be a function'); }
2119
return tryCatcherGen(fn);
22-
}
20+
};
2321

24-
function thrower(e) {
22+
module.exports.thrower = function thrower(e) {
2523
throw e;
26-
}
27-
28-
module.exports = {
29-
tryCatch: tryCatch,
30-
thrower: thrower
3124
};

src/modular/joins/plan.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
var ActivePlan = require('./activeplan');
44
var JoinObserver = require('./joinobserver');
5-
var tryCatch = require('../internal/trycatchutils').tryCatch;
5+
var tryCatchUtils = require('../internal/trycatchutils');
6+
var tryCatch = tryCatchUtils.tryCatch, errorObj = tryCatchUtils.errorObj;
67

78
function planCreateObserver(externalSubscriptions, observable, onError) {
89
var entry = externalSubscriptions.get(observable);
@@ -23,7 +24,7 @@ function handleOnError(o) { return function (e) { o.onError(e); }; }
2324
function handleOnNext(self, observer) {
2425
return function onNext () {
2526
var result = tryCatch(self._selector).apply(self, arguments);
26-
if (result === global._Rx.errorObj) { return observer.onError(result.e); }
27+
if (result === errorObj) { return observer.onError(result.e); }
2728
observer.onNext(result);
2829
};
2930
}

src/modular/observable/_extremabyobservable.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
var ObservableBase = require('./observablebase');
44
var AbstractObserver = require('../observer/abstractobserver');
5-
var tryCatch = require('../internal/trycatchutils').tryCatch;
5+
var tryCatchUtils = require('../internal/trycatchutils');
6+
var tryCatch = tryCatchUtils.tryCatch, errorObj = tryCatchUtils.errorObj;
67
var inherits = require('inherits');
78

89
function ExtremaByObserver(o, k, c) {
@@ -19,14 +20,14 @@ inherits(ExtremaByObserver, AbstractObserver);
1920

2021
ExtremaByObserver.prototype.next = function (x) {
2122
var key = tryCatch(this._k)(x);
22-
if (key === global._Rx.errorObj) { return this._o.onError(key.e); }
23+
if (key === errorObj) { return this._o.onError(key.e); }
2324
var comparison = 0;
2425
if (!this._hv) {
2526
this._hv = true;
2627
this._v = key;
2728
} else {
2829
comparison = tryCatch(this._c)(key, this._v);
29-
if (comparison === global._Rx.errorObj) { return this._o.onError(comparison.e); }
30+
if (comparison === errorObj) { return this._o.onError(comparison.e); }
3031
}
3132
if (comparison > 0) {
3233
this._v = key;

0 commit comments

Comments
 (0)