webappengine
Version:
A web application platform that can host multiple web apps running with Node.js.
3 lines • 14.6 kB
JavaScript
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"function":!0,object:!0},c=b[typeof exports]&&exports&&!exports.nodeType&&exports,d=b[typeof self]&&self.Object&&self,e=b[typeof window]&&window&&window.Object&&window,f=b[typeof module]&&module&&!module.nodeType&&module,g=(f&&f.exports===c&&c,c&&f&&"object"==typeof global&&global&&global.Object&&global),h=h=g||e!==(this&&this.window)&&e||d||this;"function"==typeof define&&define.amd?define(["rx.core"],function(b,c){return a(h,c,b)}):"object"==typeof module&&module&&module.exports===c?module.exports=a(h,module.exports,require("./rx.core")):h.Rx=a(h,{},h.Rx)}).call(this,function(a,b,c,d){function e(a){var b=[];if(!Y(a))return b;X.nonEnumArgs&&a.length&&Z(a)&&(a=slice.call(a));var c=X.enumPrototypes&&"function"==typeof a,d=X.enumErrorProps&&(a===R||a instanceof Error);for(var e in a)c&&"prototype"==e||d&&("message"==e||"name"==e)||b.push(e);if(X.nonEnumShadows&&a!==S){var f=a.constructor,g=-1,h=D;if(a===(f&&f.prototype))var i=a===T?N:a===R?I:O.call(a),j=W[i];for(;++g<h;)e=C[g],j&&j[e]||!P.call(a,e)||b.push(e)}return b}function f(a,b,c){for(var d=-1,e=c(a),f=e.length;++d<f;){var g=e[d];if(b(a[g],g,a)===!1)break}return a}function g(a,b){return f(a,b,e)}function h(a){return"function"!=typeof a.toString&&"string"==typeof(a+"")}function i(a,b,c,d){if(a===b)return 0!==a||1/a==1/b;var e=typeof a,f=typeof b;if(a===a&&(null==a||null==b||"function"!=e&&"object"!=e&&"function"!=f&&"object"!=f))return!1;var j=O.call(a),k=O.call(b);if(j==E&&(j=L),k==E&&(k=L),j!=k)return!1;switch(j){case G:case H:return+a==+b;case K:return a!=+a?b!=+b:0==a?1/a==1/b:a==+b;case M:case N:return a==String(b)}var l=j==F;if(!l){if(j!=L||!X.nodeClass&&(h(a)||h(b)))return!1;var m=!X.argsObject&&Z(a)?Object:a.constructor,n=!X.argsObject&&Z(b)?Object:b.constructor;if(!(m==n||P.call(a,"constructor")&&P.call(b,"constructor")||isFunction(m)&&m instanceof m&&isFunction(n)&&n instanceof n||!("constructor"in a&&"constructor"in b)))return!1}c||(c=[]),d||(d=[]);for(var o=c.length;o--;)if(c[o]==a)return d[o]==b;var p=0,q=!0;if(c.push(a),d.push(b),l){if(o=a.length,p=b.length,q=p==o)for(;p--;){var r=b[p];if(!(q=i(a[p],r,c,d)))break}}else g(b,function(b,e,f){return P.call(f,e)?(p++,q=P.call(a,e)&&i(a[e],b,c,d)):void 0}),q&&g(a,function(a,b,c){return P.call(c,b)?q=--p>-1:void 0});return c.pop(),d.pop(),q}function j(a,b){this.id=a,this.value=b}function k(a){this.predicate=a}function l(a){this.predicate=a}function m(a,b){var c=this;this.scheduler=a,this.messages=b,this.subscriptions=[],this.observers=[];for(var d=0,e=this.messages.length;e>d;d++){var f=this.messages[d],g=f.value;!function(b){a.scheduleAbsoluteWithState(null,f.time,function(){for(var a=c.observers.slice(0),d=0,e=a.length;e>d;d++)b.accept(a[d]);return r})}(g)}}var n,o=c.Observer,p=c.Observable,q=c.Disposable,r=q.empty,s=q.create,t=c.CompositeDisposable,u=c.SingleAssignmentDisposable,v=c.Scheduler,w=c.internals.ScheduledItem,x=c.internals.SchedulePeriodicRecursive,y=c.internals.inherits,z=c.helpers.notImplemented,A=c.helpers.defaultComparer=function(a,b){return $(a,b)},B=c.Notification=function(){function a(a,b,c,d,e,f){this.kind=a,this.value=b,this.exception=c,this._accept=d,this._acceptObservable=e,this.toString=f}return a.prototype.accept=function(a,b,c){return a&&"object"==typeof a?this._acceptObservable(a):this._accept(a,b,c)},a.prototype.toObservable=function(a){var b=this;return isScheduler(a)||(a=immediateScheduler),new AnonymousObservable(function(c){return a.scheduleWithState(b,function(a,b){b._acceptObservable(c),"N"===b.kind&&c.onCompleted()})})},a}(),C=(B.createOnNext=function(){function a(a){return a(this.value)}function b(a){return a.onNext(this.value)}function c(){return"OnNext("+this.value+")"}return function(d){return new B("N",d,null,a,b,c)}}(),B.createOnError=function(){function a(a,b){return b(this.exception)}function b(a){return a.onError(this.exception)}function c(){return"OnError("+this.exception+")"}return function(d){return new B("E",null,d,a,b,c)}}(),B.createOnCompleted=function(){function a(a,b,c){return c()}function b(a){return a.onCompleted()}function c(){return"OnCompleted()"}return function(){return new B("C",null,null,a,b,c)}}(),["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]),D=C.length,E="[object Arguments]",F="[object Array]",G="[object Boolean]",H="[object Date]",I="[object Error]",J="[object Function]",K="[object Number]",L="[object Object]",M="[object RegExp]",N="[object String]",O=Object.prototype.toString,P=Object.prototype.hasOwnProperty,Q=O.call(arguments)==E,R=Error.prototype,S=Object.prototype,T=String.prototype,U=S.propertyIsEnumerable;try{n=!(O.call(document)==L&&!({toString:0}+""))}catch(V){n=!0}var W={};W[F]=W[H]=W[K]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},W[G]=W[N]={constructor:!0,toString:!0,valueOf:!0},W[I]=W[J]=W[M]={constructor:!0,toString:!0},W[L]={constructor:!0};var X={};!function(){var a=function(){this.x=1},b=[];a.prototype={valueOf:1,y:1};for(var c in new a)b.push(c);for(c in arguments);X.enumErrorProps=U.call(R,"message")||U.call(R,"name"),X.enumPrototypes=U.call(a,"prototype"),X.nonEnumArgs=0!=c,X.nonEnumShadows=!/valueOf/.test(b)}(1);var Y=c.internals.isObject=function(a){var b=typeof a;return a&&("function"==b||"object"==b)||!1},Z=function(a){return a&&"object"==typeof a?O.call(a)==E:!1};Q||(Z=function(a){return a&&"object"==typeof a?P.call(a,"callee"):!1});var $=c.internals.isEqual=function(a,b){return i(a,b,[],[])},x=c.internals.SchedulePeriodicRecursive=function(){function a(a,b){b(0,this._period);try{this._state=this._action(this._state)}catch(c){throw this._cancel.dispose(),c}}function b(a,b,c,d){this._scheduler=a,this._state=b,this._period=c,this._action=d}return b.prototype.start=function(){var b=new u;return this._cancel=b,b.setDisposable(this._scheduler.scheduleRecursiveWithRelativeAndState(0,this._period,a.bind(this))),b},b}();j.prototype.compareTo=function(a){var b=this.value.compareTo(a.value);return 0===b&&(b=this.id-a.id),b};var _=c.internals.PriorityQueue=function(a){this.items=new Array(a),this.length=0},aa=_.prototype;aa.isHigherPriority=function(a,b){return this.items[a].compareTo(this.items[b])<0},aa.percolate=function(a){if(!(a>=this.length||0>a)){var b=a-1>>1;if(!(0>b||b===a)&&this.isHigherPriority(a,b)){var c=this.items[a];this.items[a]=this.items[b],this.items[b]=c,this.percolate(b)}}},aa.heapify=function(a){if(+a||(a=0),!(a>=this.length||0>a)){var b=2*a+1,c=2*a+2,d=a;if(b<this.length&&this.isHigherPriority(b,d)&&(d=b),c<this.length&&this.isHigherPriority(c,d)&&(d=c),d!==a){var e=this.items[a];this.items[a]=this.items[d],this.items[d]=e,this.heapify(d)}}},aa.peek=function(){return this.items[0].value},aa.removeAt=function(a){this.items[a]=this.items[--this.length],this.items[this.length]=d,this.heapify()},aa.dequeue=function(){var a=this.peek();return this.removeAt(0),a},aa.enqueue=function(a){var b=this.length++;this.items[b]=new j(_.count++,a),this.percolate(b)},aa.remove=function(a){for(var b=0;b<this.length;b++)if(this.items[b].value===a)return this.removeAt(b),!0;return!1},_.count=0;var ba=c.VirtualTimeScheduler=function(a){function b(){return this.toDateTimeOffset(this.clock)}function c(a,b){return this.scheduleAbsoluteWithState(a,this.clock,b)}function d(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b),c)}function e(a,b,c){return this.scheduleRelativeWithState(a,this.toRelative(b-this.now()),c)}function f(a,b){return b(),r}function g(f,g){this.clock=f,this.comparer=g,this.isEnabled=!1,this.queue=new _(1024),a.call(this,b,c,d,e)}y(g,a);var h=g.prototype;return h.add=z,h.toDateTimeOffset=z,h.toRelative=z,h.schedulePeriodicWithState=function(a,b,c){var d=new x(this,a,b,c);return d.start()},h.scheduleRelativeWithState=function(a,b,c){var d=this.add(this.clock,b);return this.scheduleAbsoluteWithState(a,d,c)},h.scheduleRelative=function(a,b){return this.scheduleRelativeWithState(b,a,f)},h.start=function(){if(!this.isEnabled){this.isEnabled=!0;do{var a=this.getNext();null!==a?(this.comparer(a.dueTime,this.clock)>0&&(this.clock=a.dueTime),a.invoke()):this.isEnabled=!1}while(this.isEnabled)}},h.stop=function(){this.isEnabled=!1},h.advanceTo=function(a){var b=this.comparer(this.clock,a);if(this.comparer(this.clock,a)>0)throw new ArgumentOutOfRangeError;if(0!==b&&!this.isEnabled){this.isEnabled=!0;do{var c=this.getNext();null!==c&&this.comparer(c.dueTime,a)<=0?(this.comparer(c.dueTime,this.clock)>0&&(this.clock=c.dueTime),c.invoke()):this.isEnabled=!1}while(this.isEnabled);this.clock=a}},h.advanceBy=function(a){var b=this.add(this.clock,a),c=this.comparer(this.clock,b);if(c>0)throw new ArgumentOutOfRangeError;0!==c&&this.advanceTo(b)},h.sleep=function(a){var b=this.add(this.clock,a);if(this.comparer(this.clock,b)>=0)throw new ArgumentOutOfRangeError;this.clock=b},h.getNext=function(){for(;this.queue.length>0;){var a=this.queue.peek();if(!a.isCancelled())return a;this.queue.dequeue()}return null},h.scheduleAbsolute=function(a,b){return this.scheduleAbsoluteWithState(b,a,f)},h.scheduleAbsoluteWithState=function(a,b,c){function d(a,b){return e.queue.remove(f),c(a,b)}var e=this,f=new w(this,a,d,b,this.comparer);return this.queue.enqueue(f),f.disposable},g}(v);k.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},l.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.exception)};var ca=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new da(a,new k(b)):new da(a,B.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new da(a,new l(b)):new da(a,B.createOnError(b))},onCompleted:function(a){return new da(a,B.createOnCompleted())},subscribe:function(a,b){return new ea(a,b)}},da=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||A};da.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},da.prototype.toString=function(){return this.value.toString()+"@"+this.time};var ea=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};ea.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},ea.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var fa=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};fa.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var ga=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}y(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new da(this.scheduler.clock,B.createOnNext(a)))},c.onError=function(a){this.messages.push(new da(this.scheduler.clock,B.createOnError(a)))},c.onCompleted=function(){this.messages.push(new da(this.scheduler.clock,B.createOnCompleted()))},b}(o);m.prototype.then=function(a,b){var e=this;this.subscriptions.push(new ea(this.scheduler.clock));var f,g=this.subscriptions.length-1,h=c.Observer.create(function(b){var i=a(b);if(i&&"function"==typeof i.then)f=i;else{var j=e.scheduler.clock;f=new m(e.scheduler,[c.ReactiveTest.onNext(j,d),c.ReactiveTest.onCompleted(j)])}var k=e.observers.indexOf(h);e.observers.splice(k,1),e.subscriptions[g]=new ea(e.subscriptions[g].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(h);e.observers.splice(c,1),e.subscriptions[g]=new ea(e.subscriptions[g].subscribe,e.scheduler.clock)});return this.observers.push(h),f||new m(this.scheduler,this.messages)};var ha=function(a){function b(a){var b=this;this.observers.push(a),this.subscriptions.push(new ea(this.scheduler.clock));var c=this.subscriptions.length-1;return s(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new ea(b.subscriptions[c].subscribe,b.scheduler.clock)})}function c(c,d){a.call(this,b);var e,f,g=this;this.scheduler=c,this.messages=d,this.subscriptions=[],this.observers=[];for(var h=0,i=this.messages.length;i>h;h++)e=this.messages[h],f=e.value,function(a){c.scheduleAbsoluteWithState(null,e.time,function(){for(var b=g.observers.slice(0),c=0,d=b.length;d>c;c++)a.accept(b[c]);return r})}(f)}return y(c,a),c}(p),ia=function(a){function b(a){var b,c,d=this;this.subscriptions.push(new ea(this.scheduler.clock));for(var e=this.subscriptions.length-1,f=new t,g=0,h=this.messages.length;h>g;g++)b=this.messages[g],c=b.value,function(c){f.add(d.scheduler.scheduleRelativeWithState(null,b.time,function(){return c.accept(a),r}))}(c);return s(function(){d.subscriptions[e]=new ea(d.subscriptions[e].subscribe,d.scheduler.clock),f.dispose()})}function c(c,d){a.call(this,b),this.scheduler=c,this.messages=d,this.subscriptions=[]}return y(c,a),c}(p);return c.TestScheduler=function(a){function b(a,b){return a>b?1:b>a?-1:0}function d(){a.call(this,0,b)}return y(d,a),d.prototype.scheduleAbsoluteWithState=function(b,c,d){return c<=this.clock&&(c=this.clock+1),a.prototype.scheduleAbsoluteWithState.call(this,b,c,d)},d.prototype.add=function(a,b){return a+b},d.prototype.toDateTimeOffset=function(a){return new Date(a).getTime()},d.prototype.toRelative=function(a){return a},d.prototype.startWithTiming=function(a,b,c,d){var e,f,g=this.createObserver();return this.scheduleAbsoluteWithState(null,b,function(){return e=a(),r}),this.scheduleAbsoluteWithState(null,c,function(){return f=e.subscribe(g),r}),this.scheduleAbsoluteWithState(null,d,function(){return f.dispose(),r}),this.start(),g},d.prototype.startWithDispose=function(a,b){return this.startWithTiming(a,ca.created,ca.subscribed,b)},d.prototype.startWithCreate=function(a){return this.startWithTiming(a,ca.created,ca.subscribed,ca.disposed)},d.prototype.createHotObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new ha(this,a)},d.prototype.createColdObservable=function(){var a,b=arguments.length;if(Array.isArray(arguments[0]))a=arguments[0];else{a=new Array(b);for(var c=0;b>c;c++)a[c]=arguments[c]}return new ia(this,a)},d.prototype.createResolvedPromise=function(a,b){return new m(this,[c.ReactiveTest.onNext(a,b),c.ReactiveTest.onCompleted(a)])},d.prototype.createRejectedPromise=function(a,b){return new m(this,[c.ReactiveTest.onError(a,b)])},d.prototype.createObserver=function(){return new ga(this)},d}(ba),c});
//# sourceMappingURL=rx.core.testing.map