Bones/node_modules/rx/dist/rx.testing.min.js

3 lines
6.3 KiB
JavaScript
Raw Normal View History

2017-05-17 13:45:25 -04:00
/* Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.*/
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx.virtualtime","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx.all")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b){return 1===a.length&&Array.isArray(a[b])?a[b]:q.call(a)}function f(a){this.predicate=a}function g(a){this.predicate=a}function h(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 n})}(g)}}var i=c.Observer,j=c.Observable,k=c.Notification,l=c.VirtualTimeScheduler,m=c.Disposable,n=m.empty,o=m.create,p=c.CompositeDisposable,q=(c.SingleAssignmentDisposable,Array.prototype.slice),r=c.internals.inherits,s=c.internals.isEqual;f.prototype.equals=function(a){return a===this?!0:null==a?!1:"N"!==a.kind?!1:this.predicate(a.value)},g.prototype.equals=function(a){return a===this?!0:null==a?!1:"E"!==a.kind?!1:this.predicate(a.exception)};var t=c.ReactiveTest={created:100,subscribed:200,disposed:1e3,onNext:function(a,b){return"function"==typeof b?new u(a,new f(b)):new u(a,k.createOnNext(b))},onError:function(a,b){return"function"==typeof b?new u(a,new g(b)):new u(a,k.createOnError(b))},onCompleted:function(a){return new u(a,k.createOnCompleted())},subscribe:function(a,b){return new v(a,b)}},u=c.Recorded=function(a,b,c){this.time=a,this.value=b,this.comparer=c||s};u.prototype.equals=function(a){return this.time===a.time&&this.comparer(this.value,a.value)},u.prototype.toString=function(){return this.value.toString()+"@"+this.time};var v=c.Subscription=function(a,b){this.subscribe=a,this.unsubscribe=b||Number.MAX_VALUE};v.prototype.equals=function(a){return this.subscribe===a.subscribe&&this.unsubscribe===a.unsubscribe},v.prototype.toString=function(){return"("+this.subscribe+", "+(this.unsubscribe===Number.MAX_VALUE?"Infinite":this.unsubscribe)+")"};var w=c.MockDisposable=function(a){this.scheduler=a,this.disposes=[],this.disposes.push(this.scheduler.clock)};w.prototype.dispose=function(){this.disposes.push(this.scheduler.clock)};var x=function(a){function b(b){a.call(this),this.scheduler=b,this.messages=[]}r(b,a);var c=b.prototype;return c.onNext=function(a){this.messages.push(new u(this.scheduler.clock,k.createOnNext(a)))},c.onError=function(a){this.messages.push(new u(this.scheduler.clock,k.createOnError(a)))},c.onCompleted=function(){this.messages.push(new u(this.scheduler.clock,k.createOnCompleted()))},b}(i);h.prototype.then=function(a,b){var e=this;this.subscriptions.push(new v(this.scheduler.clock));var f,g=this.subscriptions.length-1,i=c.Observer.create(function(b){var j=a(b);if(j&&"function"==typeof j.then)f=j;else{var k=e.scheduler.clock;f=new h(e.scheduler,[c.ReactiveTest.onNext(k,d),c.ReactiveTest.onCompleted(k)])}var l=e.observers.indexOf(i);e.observers.splice(l,1),e.subscriptions[g]=new v(e.subscriptions[g].subscribe,e.scheduler.clock)},function(a){b(a);var c=e.observers.indexOf(i);e.observers.splice(c,1),e.subscriptions[g]=new v(e.subscriptions[g].subscribe,e.scheduler.clock)});return this.observers.push(i),f||new h(this.scheduler,this.messages)};var y=function(a){function b(a){var b=this;this.observers.push(a),this.subscriptions.push(new v(this.scheduler.clock));var c=this.subscriptions.length-1;return o(function(){var d=b.observers.indexOf(a);b.observers.splice(d,1),b.subscriptions[c]=new v(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
//# sourceMappingURL=rx.testing.map