formal-0.1.0: lib/js/jasmine-1.0.1/jasmine.js
var jasmine={unimplementedMethod_:function(){throw Error("unimplemented method");}};jasmine.undefined=jasmine.___undefined___;jasmine.DEFAULT_UPDATE_INTERVAL=250;jasmine.DEFAULT_TIMEOUT_INTERVAL=5E3;jasmine.getGlobal=function(){return function(){return this}()};jasmine.bindOriginal_=function(a,b){var c=a[b];return c.apply?function(){return c.apply(a,arguments)}:jasmine.getGlobal()[b]};jasmine.setTimeout=jasmine.bindOriginal_(jasmine.getGlobal(),"setTimeout");
jasmine.clearTimeout=jasmine.bindOriginal_(jasmine.getGlobal(),"clearTimeout");jasmine.setInterval=jasmine.bindOriginal_(jasmine.getGlobal(),"setInterval");jasmine.clearInterval=jasmine.bindOriginal_(jasmine.getGlobal(),"clearInterval");jasmine.MessageResult=function(a){this.type="log";this.values=a;this.trace=Error()};
jasmine.MessageResult.prototype.toString=function(){for(var a="",b=0;b<this.values.length;b++)0<b&&(a+=" "),a=jasmine.isString_(this.values[b])?a+this.values[b]:a+jasmine.pp(this.values[b]);return a};jasmine.ExpectationResult=function(a){this.type="expect";this.matcherName=a.matcherName;this.passed_=a.passed;this.expected=a.expected;this.actual=a.actual;this.message=this.passed_?"Passed.":a.message;this.trace=this.passed_?"":Error(this.message)};jasmine.ExpectationResult.prototype.toString=function(){return this.message};
jasmine.ExpectationResult.prototype.passed=function(){return this.passed_};jasmine.getEnv=function(){return jasmine.currentEnv_=jasmine.currentEnv_||new jasmine.Env};jasmine.isArray_=function(a){return jasmine.isA_("Array",a)};jasmine.isString_=function(a){return jasmine.isA_("String",a)};jasmine.isNumber_=function(a){return jasmine.isA_("Number",a)};jasmine.isA_=function(a,b){return Object.prototype.toString.apply(b)==="[object "+a+"]"};
jasmine.pp=function(a){var b=new jasmine.StringPrettyPrinter;b.format(a);return b.string};jasmine.isDomNode=function(a){return 0<a.nodeType};jasmine.any=function(a){return new jasmine.Matchers.Any(a)};jasmine.Spy=function(a){this.identity=a||"unknown";this.isSpy=!0;this.plan=function(){};this.mostRecentCall={};this.argsForCall=[];this.calls=[]};jasmine.Spy.prototype.andCallThrough=function(){this.plan=this.originalValue;return this};
jasmine.Spy.prototype.andReturn=function(a){this.plan=function(){return a};return this};jasmine.Spy.prototype.andThrow=function(a){this.plan=function(){throw a;};return this};jasmine.Spy.prototype.andCallFake=function(a){this.plan=a;return this};jasmine.Spy.prototype.reset=function(){this.wasCalled=!1;this.callCount=0;this.argsForCall=[];this.calls=[];this.mostRecentCall={}};
jasmine.createSpy=function(a){var b=function(){b.wasCalled=!0;b.callCount++;var a=jasmine.util.argsToArray(arguments);b.mostRecentCall.object=this;b.mostRecentCall.args=a;b.argsForCall.push(a);b.calls.push({object:this,args:a});return b.plan.apply(this,arguments)},a=new jasmine.Spy(a),c;for(c in a)b[c]=a[c];b.reset();return b};jasmine.isSpy=function(a){return a&&a.isSpy};
jasmine.createSpyObj=function(a,b){if(!jasmine.isArray_(b)||0==b.length)throw Error("createSpyObj requires a non-empty array of method names to create spies for");for(var c={},d=0;d<b.length;d++)c[b[d]]=jasmine.createSpy(a+"."+b[d]);return c};jasmine.log=function(){var a=jasmine.getEnv().currentSpec;a.log.apply(a,arguments)};
var spyOn=function(a,b){return jasmine.getEnv().currentSpec.spyOn(a,b)},it=function(a,b){return jasmine.getEnv().it(a,b)},xit=function(a,b){return jasmine.getEnv().xit(a,b)},expect=function(a){return jasmine.getEnv().currentSpec.expect(a)},runs=function(a){jasmine.getEnv().currentSpec.runs(a)},waits=function(a){jasmine.getEnv().currentSpec.waits(a)},waitsFor=function(a,b,c){jasmine.getEnv().currentSpec.waitsFor.apply(jasmine.getEnv().currentSpec,arguments)},beforeEach=function(a){jasmine.getEnv().beforeEach(a)},
afterEach=function(a){jasmine.getEnv().afterEach(a)},describe=function(a,b){return jasmine.getEnv().describe(a,b)},xdescribe=function(a,b){return jasmine.getEnv().xdescribe(a,b)};
jasmine.XmlHttpRequest="undefined"==typeof XMLHttpRequest?function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(b){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(c){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest.");}:XMLHttpRequest;jasmine.util={};jasmine.util.inherit=function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c};
jasmine.util.formatException=function(a){var b;a.line?b=a.line:a.lineNumber&&(b=a.lineNumber);var c;a.sourceURL?c=a.sourceURL:a.fileName&&(c=a.fileName);a=a.name&&a.message?a.name+": "+a.message:a.toString();c&&b&&(a+=" in "+c+" (line "+b+")");return a};jasmine.util.htmlEscape=function(a){return!a?a:a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")};jasmine.util.argsToArray=function(a){for(var b=[],c=0;c<a.length;c++)b.push(a[c]);return b};
jasmine.util.extend=function(a,b){for(var c in b)a[c]=b[c];return a};
jasmine.Env=function(){this.currentSuite=this.currentSpec=null;this.currentRunner_=new jasmine.Runner(this);this.reporter=new jasmine.MultiReporter;this.updateInterval=jasmine.DEFAULT_UPDATE_INTERVAL;this.defaultTimeoutInterval=jasmine.DEFAULT_TIMEOUT_INTERVAL;this.lastUpdate=0;this.specFilter=function(){return!0};this.nextSuiteId_=this.nextSpecId_=0;this.equalityTesters_=[];this.matchersClass=function(){jasmine.Matchers.apply(this,arguments)};jasmine.util.inherit(this.matchersClass,jasmine.Matchers);
jasmine.Matchers.wrapInto_(jasmine.Matchers.prototype,this.matchersClass)};jasmine.Env.prototype.setTimeout=jasmine.setTimeout;jasmine.Env.prototype.clearTimeout=jasmine.clearTimeout;jasmine.Env.prototype.setInterval=jasmine.setInterval;jasmine.Env.prototype.clearInterval=jasmine.clearInterval;jasmine.Env.prototype.version=function(){if(jasmine.version_)return jasmine.version_;throw Error("Version not set");};
jasmine.Env.prototype.versionString=function(){if(jasmine.version_){var a=this.version();return a.major+"."+a.minor+"."+a.build+" revision "+a.revision}return"version unknown"};jasmine.Env.prototype.nextSpecId=function(){return this.nextSpecId_++};jasmine.Env.prototype.nextSuiteId=function(){return this.nextSuiteId_++};jasmine.Env.prototype.addReporter=function(a){this.reporter.addReporter(a)};jasmine.Env.prototype.execute=function(){this.currentRunner_.execute()};
jasmine.Env.prototype.describe=function(a,b){var c=new jasmine.Suite(this,a,b,this.currentSuite),d=this.currentSuite;d?d.add(c):this.currentRunner_.add(c);this.currentSuite=c;var e=null;try{b.call(c)}catch(f){e=f}this.currentSuite=d;e&&this.it("encountered a declaration exception",function(){throw e;});return c};jasmine.Env.prototype.beforeEach=function(a){this.currentSuite?this.currentSuite.beforeEach(a):this.currentRunner_.beforeEach(a)};jasmine.Env.prototype.currentRunner=function(){return this.currentRunner_};
jasmine.Env.prototype.afterEach=function(a){this.currentSuite?this.currentSuite.afterEach(a):this.currentRunner_.afterEach(a)};jasmine.Env.prototype.xdescribe=function(){return{execute:function(){}}};jasmine.Env.prototype.it=function(a,b){var c=new jasmine.Spec(this,this.currentSuite,a);this.currentSuite.add(c);this.currentSpec=c;b&&c.runs(b);return c};jasmine.Env.prototype.xit=function(){return{id:this.nextSpecId(),runs:function(){}}};
jasmine.Env.prototype.compareObjects_=function(a,b,c,d){if(a.__Jasmine_been_here_before__===b&&b.__Jasmine_been_here_before__===a)return!0;a.__Jasmine_been_here_before__=b;b.__Jasmine_been_here_before__=a;var e=function(a,b){return null!=a&&a[b]!==jasmine.undefined},f;for(f in b)!e(a,f)&&e(b,f)&&c.push("expected has key '"+f+"', but missing from actual.");for(f in a)!e(b,f)&&e(a,f)&&c.push("expected missing key '"+f+"', but present in actual.");for(f in b)"__Jasmine_been_here_before__"!=f&&(this.equals_(a[f],
b[f],c,d)||d.push("'"+f+"' was '"+(b[f]?jasmine.util.htmlEscape(b[f].toString()):b[f])+"' in expected, but was '"+(a[f]?jasmine.util.htmlEscape(a[f].toString()):a[f])+"' in actual."));jasmine.isArray_(a)&&(jasmine.isArray_(b)&&a.length!=b.length)&&d.push("arrays were not the same length");delete a.__Jasmine_been_here_before__;delete b.__Jasmine_been_here_before__;return 0==c.length&&0==d.length};
jasmine.Env.prototype.equals_=function(a,b,c,d){for(var c=c||[],d=d||[],e=0;e<this.equalityTesters_.length;e++){var f=(0,this.equalityTesters_[e])(a,b,this,c,d);if(f!==jasmine.undefined)return f}return a===b?!0:a===jasmine.undefined||null===a||b===jasmine.undefined||null===b?a==jasmine.undefined&&b==jasmine.undefined:jasmine.isDomNode(a)&&jasmine.isDomNode(b)?a===b:a instanceof Date&&b instanceof Date?a.getTime()==b.getTime():a instanceof jasmine.Matchers.Any?a.matches(b):b instanceof jasmine.Matchers.Any?
b.matches(a):jasmine.isString_(a)&&jasmine.isString_(b)||jasmine.isNumber_(a)&&jasmine.isNumber_(b)?a==b:"object"===typeof a&&"object"===typeof b?this.compareObjects_(a,b,c,d):a===b};jasmine.Env.prototype.contains_=function(a,b){if(jasmine.isArray_(a)){for(var c=0;c<a.length;c++)if(this.equals_(a[c],b))return!0;return!1}return 0<=a.indexOf(b)};jasmine.Env.prototype.addEqualityTester=function(a){this.equalityTesters_.push(a)};jasmine.Reporter=function(){};
jasmine.Reporter.prototype.reportRunnerStarting=function(){};jasmine.Reporter.prototype.reportRunnerResults=function(){};jasmine.Reporter.prototype.reportSuiteResults=function(){};jasmine.Reporter.prototype.reportSpecStarting=function(){};jasmine.Reporter.prototype.reportSpecResults=function(){};jasmine.Reporter.prototype.log=function(){};jasmine.Block=function(a,b,c){this.env=a;this.func=b;this.spec=c};jasmine.Block.prototype.execute=function(a){try{this.func.apply(this.spec)}catch(b){this.spec.fail(b)}a()};
jasmine.JsApiReporter=function(){this.finished=this.started=!1;this.suites_=[];this.results_={}};jasmine.JsApiReporter.prototype.reportRunnerStarting=function(a){this.started=!0;for(var a=a.topLevelSuites(),b=0;b<a.length;b++)this.suites_.push(this.summarize_(a[b]))};jasmine.JsApiReporter.prototype.suites=function(){return this.suites_};
jasmine.JsApiReporter.prototype.summarize_=function(a){var b=a instanceof jasmine.Suite,c={id:a.id,name:a.description,type:b?"suite":"spec",children:[]};if(b){a=a.children();for(b=0;b<a.length;b++)c.children.push(this.summarize_(a[b]))}return c};jasmine.JsApiReporter.prototype.results=function(){return this.results_};jasmine.JsApiReporter.prototype.resultsForSpec=function(a){return this.results_[a]};jasmine.JsApiReporter.prototype.reportRunnerResults=function(){this.finished=!0};
jasmine.JsApiReporter.prototype.reportSuiteResults=function(){};jasmine.JsApiReporter.prototype.reportSpecResults=function(a){this.results_[a.id]={messages:a.results().getItems(),result:0<a.results().failedCount?"failed":"passed"}};jasmine.JsApiReporter.prototype.log=function(){};jasmine.JsApiReporter.prototype.resultsForSpecs=function(a){for(var b={},c=0;c<a.length;c++){var d=a[c];b[d]=this.summarizeResult_(this.results_[d])}return b};
jasmine.JsApiReporter.prototype.summarizeResult_=function(a){for(var b=[],c=a.messages.length,d=0;d<c;d++){var e=a.messages[d];b.push({text:"log"==e.type?e.toString():jasmine.undefined,passed:e.passed?e.passed():!0,type:e.type,message:e.message,trace:{stack:e.passed&&!e.passed()?e.trace.stack:jasmine.undefined}})}return{result:a.result,messages:b}};jasmine.Matchers=function(a,b,c,d){this.env=a;this.actual=b;this.spec=c;this.isNot=d||!1;this.reportWasCalled_=!1};
jasmine.Matchers.pp=function(){throw Error("jasmine.Matchers.pp() is no longer supported, please use jasmine.pp() instead!");};jasmine.Matchers.prototype.report=function(){throw Error("As of jasmine 0.11, custom matchers must be implemented differently -- please see jasmine docs");};jasmine.Matchers.wrapInto_=function(a,b){for(var c in a)"report"!=c&&(b.prototype[c]=jasmine.Matchers.matcherFn_(c,a[c]))};
jasmine.Matchers.matcherFn_=function(a,b){return function(){var c=jasmine.util.argsToArray(arguments),d=b.apply(this,arguments);this.isNot&&(d=!d);if(this.reportWasCalled_)return d;var e;if(!d)if(this.message)e=this.message.apply(this,arguments),jasmine.isArray_(e)&&(e=e[this.isNot?1:0]);else{e=a.replace(/[A-Z]/g,function(a){return" "+a.toLowerCase()});e="Expected "+jasmine.pp(this.actual)+(this.isNot?" not ":" ")+e;if(0<c.length)for(var f=0;f<c.length;f++)0<f&&(e+=","),e+=" "+jasmine.pp(c[f]);e+=
"."}this.spec.addMatcherResult(new jasmine.ExpectationResult({matcherName:a,passed:d,expected:1<c.length?c:c[0],actual:this.actual,message:e}));return jasmine.undefined}};jasmine.Matchers.prototype.toBe=function(a){return this.actual===a};jasmine.Matchers.prototype.toNotBe=function(a){return this.actual!==a};jasmine.Matchers.prototype.toEqual=function(a){return this.env.equals_(this.actual,a)};jasmine.Matchers.prototype.toNotEqual=function(a){return!this.env.equals_(this.actual,a)};
jasmine.Matchers.prototype.toMatch=function(a){return RegExp(a).test(this.actual)};jasmine.Matchers.prototype.toNotMatch=function(a){return!RegExp(a).test(this.actual)};jasmine.Matchers.prototype.toBeDefined=function(){return this.actual!==jasmine.undefined};jasmine.Matchers.prototype.toBeUndefined=function(){return this.actual===jasmine.undefined};jasmine.Matchers.prototype.toBeNull=function(){return null===this.actual};jasmine.Matchers.prototype.toBeTruthy=function(){return!!this.actual};
jasmine.Matchers.prototype.toBeFalsy=function(){return!this.actual};jasmine.Matchers.prototype.toHaveBeenCalled=function(){if(0<arguments.length)throw Error("toHaveBeenCalled does not take arguments, use toHaveBeenCalledWith");if(!jasmine.isSpy(this.actual))throw Error("Expected a spy, but got "+jasmine.pp(this.actual)+".");this.message=function(){return["Expected spy "+this.actual.identity+" to have been called.","Expected spy "+this.actual.identity+" not to have been called."]};return this.actual.wasCalled};
jasmine.Matchers.prototype.wasCalled=jasmine.Matchers.prototype.toHaveBeenCalled;jasmine.Matchers.prototype.wasNotCalled=function(){if(0<arguments.length)throw Error("wasNotCalled does not take arguments");if(!jasmine.isSpy(this.actual))throw Error("Expected a spy, but got "+jasmine.pp(this.actual)+".");this.message=function(){return["Expected spy "+this.actual.identity+" to not have been called.","Expected spy "+this.actual.identity+" to have been called."]};return!this.actual.wasCalled};
jasmine.Matchers.prototype.toHaveBeenCalledWith=function(){var a=jasmine.util.argsToArray(arguments);if(!jasmine.isSpy(this.actual))throw Error("Expected a spy, but got "+jasmine.pp(this.actual)+".");this.message=function(){return 0==this.actual.callCount?["Expected spy to have been called with "+jasmine.pp(a)+" but it was never called.","Expected spy not to have been called with "+jasmine.pp(a)+" but it was."]:["Expected spy to have been called with "+jasmine.pp(a)+" but was called with "+jasmine.pp(this.actual.argsForCall),
"Expected spy not to have been called with "+jasmine.pp(a)+" but was called with "+jasmine.pp(this.actual.argsForCall)]};return this.env.contains_(this.actual.argsForCall,a)};jasmine.Matchers.prototype.wasCalledWith=jasmine.Matchers.prototype.toHaveBeenCalledWith;
jasmine.Matchers.prototype.wasNotCalledWith=function(){var a=jasmine.util.argsToArray(arguments);if(!jasmine.isSpy(this.actual))throw Error("Expected a spy, but got "+jasmine.pp(this.actual)+".");this.message=function(){return["Expected spy not to have been called with "+jasmine.pp(a)+" but it was","Expected spy to have been called with "+jasmine.pp(a)+" but it was"]};return!this.env.contains_(this.actual.argsForCall,a)};
jasmine.Matchers.prototype.toContain=function(a){return this.env.contains_(this.actual,a)};jasmine.Matchers.prototype.toNotContain=function(a){return!this.env.contains_(this.actual,a)};jasmine.Matchers.prototype.toBeLessThan=function(a){return this.actual<a};jasmine.Matchers.prototype.toBeGreaterThan=function(a){return this.actual>a};
jasmine.Matchers.prototype.toThrow=function(a){var b=!1,c;if("function"!=typeof this.actual)throw Error("Actual is not a function");try{this.actual()}catch(d){c=d}c&&(b=a===jasmine.undefined||this.env.equals_(c.message||c,a.message||a));var e=this.isNot?"not ":"";this.message=function(){return c&&(a===jasmine.undefined||!this.env.equals_(c.message||c,a.message||a))?["Expected function "+e+"to throw",a?a.message||a:" an exception",", but it threw",c.message||c].join(" "):"Expected function to throw an exception."};
return b};jasmine.Matchers.Any=function(a){this.expectedClass=a};jasmine.Matchers.Any.prototype.matches=function(a){return this.expectedClass==String?"string"==typeof a||a instanceof String:this.expectedClass==Number?"number"==typeof a||a instanceof Number:this.expectedClass==Function?"function"==typeof a||a instanceof Function:this.expectedClass==Object?"object"==typeof a:a instanceof this.expectedClass};
jasmine.Matchers.Any.prototype.toString=function(){return"<jasmine.any("+this.expectedClass+")>"};jasmine.MultiReporter=function(){this.subReporters_=[]};jasmine.util.inherit(jasmine.MultiReporter,jasmine.Reporter);jasmine.MultiReporter.prototype.addReporter=function(a){this.subReporters_.push(a)};
(function(){for(var a="reportRunnerStarting reportRunnerResults reportSuiteResults reportSpecStarting reportSpecResults log".split(" "),b=0;b<a.length;b++){var c=a[b];jasmine.MultiReporter.prototype[c]=function(a){return function(){for(var b=0;b<this.subReporters_.length;b++){var c=this.subReporters_[b];c[a]&&c[a].apply(c,arguments)}}}(c)}})();jasmine.NestedResults=function(){this.failedCount=this.passedCount=this.totalCount=0;this.skipped=!1;this.items_=[]};
jasmine.NestedResults.prototype.rollupCounts=function(a){this.totalCount+=a.totalCount;this.passedCount+=a.passedCount;this.failedCount+=a.failedCount};jasmine.NestedResults.prototype.log=function(a){this.items_.push(new jasmine.MessageResult(a))};jasmine.NestedResults.prototype.getItems=function(){return this.items_};jasmine.NestedResults.prototype.addResult=function(a){"log"!=a.type&&(a.items_?this.rollupCounts(a):(this.totalCount++,a.passed()?this.passedCount++:this.failedCount++));this.items_.push(a)};
jasmine.NestedResults.prototype.passed=function(){return this.passedCount===this.totalCount};jasmine.PrettyPrinter=function(){this.ppNestLevel_=0};
jasmine.PrettyPrinter.prototype.format=function(a){if(40<this.ppNestLevel_)throw Error("jasmine.PrettyPrinter: format() nested too deeply!");this.ppNestLevel_++;try{a===jasmine.undefined?this.emitScalar("undefined"):null===a?this.emitScalar("null"):a===jasmine.getGlobal()?this.emitScalar("<global>"):a instanceof jasmine.Matchers.Any?this.emitScalar(a.toString()):"string"===typeof a?this.emitString(a):jasmine.isSpy(a)?this.emitScalar("spy on "+a.identity):a instanceof RegExp?this.emitScalar(a.toString()):
"function"===typeof a?this.emitScalar("Function"):"number"===typeof a.nodeType?this.emitScalar("HTMLNode"):a instanceof Date?this.emitScalar("Date("+a+")"):a.__Jasmine_been_here_before__?this.emitScalar("<circular reference: "+(jasmine.isArray_(a)?"Array":"Object")+">"):jasmine.isArray_(a)||"object"==typeof a?(a.__Jasmine_been_here_before__=!0,jasmine.isArray_(a)?this.emitArray(a):this.emitObject(a),delete a.__Jasmine_been_here_before__):this.emitScalar(a.toString())}finally{this.ppNestLevel_--}};
jasmine.PrettyPrinter.prototype.iterateObject=function(a,b){for(var c in a)"__Jasmine_been_here_before__"!=c&&b(c,a.__lookupGetter__?null!=a.__lookupGetter__(c):!1)};jasmine.PrettyPrinter.prototype.emitArray=jasmine.unimplementedMethod_;jasmine.PrettyPrinter.prototype.emitObject=jasmine.unimplementedMethod_;jasmine.PrettyPrinter.prototype.emitScalar=jasmine.unimplementedMethod_;jasmine.PrettyPrinter.prototype.emitString=jasmine.unimplementedMethod_;
jasmine.StringPrettyPrinter=function(){jasmine.PrettyPrinter.call(this);this.string=""};jasmine.util.inherit(jasmine.StringPrettyPrinter,jasmine.PrettyPrinter);jasmine.StringPrettyPrinter.prototype.emitScalar=function(a){this.append(a)};jasmine.StringPrettyPrinter.prototype.emitString=function(a){this.append("'"+a+"'")};jasmine.StringPrettyPrinter.prototype.emitArray=function(a){this.append("[ ");for(var b=0;b<a.length;b++)0<b&&this.append(", "),this.format(a[b]);this.append(" ]")};
jasmine.StringPrettyPrinter.prototype.emitObject=function(a){var b=this;this.append("{ ");var c=!0;this.iterateObject(a,function(d,e){c?c=!1:b.append(", ");b.append(d);b.append(" : ");e?b.append("<getter>"):b.format(a[d])});this.append(" }")};jasmine.StringPrettyPrinter.prototype.append=function(a){this.string+=a};jasmine.Queue=function(a){this.env=a;this.blocks=[];this.running=!1;this.offset=this.index=0;this.abort=!1};jasmine.Queue.prototype.addBefore=function(a){this.blocks.unshift(a)};
jasmine.Queue.prototype.add=function(a){this.blocks.push(a)};jasmine.Queue.prototype.insertNext=function(a){this.blocks.splice(this.index+this.offset+1,0,a);this.offset++};jasmine.Queue.prototype.start=function(a){this.running=!0;this.onComplete=a;this.next_()};jasmine.Queue.prototype.isRunning=function(){return this.running};jasmine.Queue.LOOP_DONT_RECURSE=!0;
jasmine.Queue.prototype.next_=function(){for(var a=this,b=!0;b;)if(b=!1,a.index<a.blocks.length&&!this.abort){var c=!0,d=!1,e=function(){if(jasmine.Queue.LOOP_DONT_RECURSE&&c)d=!0;else{a.blocks[a.index].abort&&(a.abort=!0);a.offset=0;a.index++;var e=(new Date).getTime();a.env.updateInterval&&e-a.env.lastUpdate>a.env.updateInterval?(a.env.lastUpdate=e,a.env.setTimeout(function(){a.next_()},0)):jasmine.Queue.LOOP_DONT_RECURSE&&d?b=!0:a.next_()}};a.blocks[a.index].execute(e);c=!1;d&&e()}else if(a.running=
!1,a.onComplete)a.onComplete()};jasmine.Queue.prototype.results=function(){for(var a=new jasmine.NestedResults,b=0;b<this.blocks.length;b++)this.blocks[b].results&&a.addResult(this.blocks[b].results());return a};jasmine.Runner=function(a){this.env=a;this.queue=new jasmine.Queue(a);this.before_=[];this.after_=[];this.suites_=[]};jasmine.Runner.prototype.execute=function(){var a=this;a.env.reporter.reportRunnerStarting&&a.env.reporter.reportRunnerStarting(this);a.queue.start(function(){a.finishCallback()})};
jasmine.Runner.prototype.beforeEach=function(a){a.typeName="beforeEach";this.before_.splice(0,0,a)};jasmine.Runner.prototype.afterEach=function(a){a.typeName="afterEach";this.after_.splice(0,0,a)};jasmine.Runner.prototype.finishCallback=function(){this.env.reporter.reportRunnerResults(this)};jasmine.Runner.prototype.addSuite=function(a){this.suites_.push(a)};jasmine.Runner.prototype.add=function(a){a instanceof jasmine.Suite&&this.addSuite(a);this.queue.add(a)};
jasmine.Runner.prototype.specs=function(){for(var a=this.suites(),b=[],c=0;c<a.length;c++)b=b.concat(a[c].specs());return b};jasmine.Runner.prototype.suites=function(){return this.suites_};jasmine.Runner.prototype.topLevelSuites=function(){for(var a=[],b=0;b<this.suites_.length;b++)this.suites_[b].parentSuite||a.push(this.suites_[b]);return a};jasmine.Runner.prototype.results=function(){return this.queue.results()};
jasmine.Spec=function(a,b,c){if(!a)throw Error("jasmine.Env() required");if(!b)throw Error("jasmine.Suite() required");this.id=a.nextSpecId?a.nextSpecId():null;this.env=a;this.suite=b;this.description=c;this.queue=new jasmine.Queue(a);this.afterCallbacks=[];this.spies_=[];this.results_=new jasmine.NestedResults;this.results_.description=c;this.matchersClass=null};jasmine.Spec.prototype.getFullName=function(){return this.suite.getFullName()+" "+this.description+"."};
jasmine.Spec.prototype.results=function(){return this.results_};jasmine.Spec.prototype.log=function(){return this.results_.log(arguments)};jasmine.Spec.prototype.runs=function(a){this.addToQueue(new jasmine.Block(this.env,a,this));return this};jasmine.Spec.prototype.addToQueue=function(a){this.queue.isRunning()?this.queue.insertNext(a):this.queue.add(a)};jasmine.Spec.prototype.addMatcherResult=function(a){this.results_.addResult(a)};
jasmine.Spec.prototype.expect=function(a){var b=new (this.getMatchersClass_())(this.env,a,this);b.not=new (this.getMatchersClass_())(this.env,a,this,!0);return b};jasmine.Spec.prototype.waits=function(a){this.addToQueue(new jasmine.WaitsBlock(this.env,a,this));return this};
jasmine.Spec.prototype.waitsFor=function(a,b,c){for(var d=null,e=null,f=null,g=0;g<arguments.length;g++){var h=arguments[g];switch(typeof h){case "function":d=h;break;case "string":e=h;break;case "number":f=h}}this.addToQueue(new jasmine.WaitsForBlock(this.env,f,d,e,this));return this};jasmine.Spec.prototype.fail=function(a){this.results_.addResult(new jasmine.ExpectationResult({passed:!1,message:a?jasmine.util.formatException(a):"Exception"}))};
jasmine.Spec.prototype.getMatchersClass_=function(){return this.matchersClass||this.env.matchersClass};jasmine.Spec.prototype.addMatchers=function(a){var b=this.getMatchersClass_(),c=function(){b.apply(this,arguments)};jasmine.util.inherit(c,b);jasmine.Matchers.wrapInto_(a,c);this.matchersClass=c};jasmine.Spec.prototype.finishCallback=function(){this.env.reporter.reportSpecResults(this)};jasmine.Spec.prototype.finish=function(a){this.removeAllSpies();this.finishCallback();a&&a()};
jasmine.Spec.prototype.after=function(a){this.queue.isRunning()?this.queue.add(new jasmine.Block(this.env,a,this)):this.afterCallbacks.unshift(a)};jasmine.Spec.prototype.execute=function(a){var b=this;b.env.specFilter(b)?(this.env.reporter.reportSpecStarting(this),b.env.currentSpec=b,b.addBeforesAndAftersToQueue(),b.queue.start(function(){b.finish(a)})):(b.results_.skipped=!0,b.finish(a))};
jasmine.Spec.prototype.addBeforesAndAftersToQueue=function(){for(var a=this.env.currentRunner(),b,c=this.suite;c;c=c.parentSuite)for(b=0;b<c.before_.length;b++)this.queue.addBefore(new jasmine.Block(this.env,c.before_[b],this));for(b=0;b<a.before_.length;b++)this.queue.addBefore(new jasmine.Block(this.env,a.before_[b],this));for(b=0;b<this.afterCallbacks.length;b++)this.queue.add(new jasmine.Block(this.env,this.afterCallbacks[b],this));for(c=this.suite;c;c=c.parentSuite)for(b=0;b<c.after_.length;b++)this.queue.add(new jasmine.Block(this.env,
c.after_[b],this));for(b=0;b<a.after_.length;b++)this.queue.add(new jasmine.Block(this.env,a.after_[b],this))};jasmine.Spec.prototype.explodes=function(){throw"explodes function should not have been called";};
jasmine.Spec.prototype.spyOn=function(a,b,c){if(a==jasmine.undefined)throw"spyOn could not find an object to spy upon for "+b+"()";if(!c&&a[b]===jasmine.undefined)throw b+"() method does not exist";if(!c&&a[b]&&a[b].isSpy)throw Error(b+" has already been spied upon");c=jasmine.createSpy(b);this.spies_.push(c);c.baseObj=a;c.methodName=b;c.originalValue=a[b];return a[b]=c};
jasmine.Spec.prototype.removeAllSpies=function(){for(var a=0;a<this.spies_.length;a++){var b=this.spies_[a];b.baseObj[b.methodName]=b.originalValue}this.spies_=[]};jasmine.Suite=function(a,b,c,d){this.id=a.nextSuiteId?a.nextSuiteId():null;this.description=b;this.queue=new jasmine.Queue(a);this.parentSuite=d;this.env=a;this.before_=[];this.after_=[];this.children_=[];this.suites_=[];this.specs_=[]};
jasmine.Suite.prototype.getFullName=function(){for(var a=this.description,b=this.parentSuite;b;b=b.parentSuite)a=b.description+" "+a;return a};jasmine.Suite.prototype.finish=function(a){this.env.reporter.reportSuiteResults(this);this.finished=!0;"function"==typeof a&&a()};jasmine.Suite.prototype.beforeEach=function(a){a.typeName="beforeEach";this.before_.unshift(a)};jasmine.Suite.prototype.afterEach=function(a){a.typeName="afterEach";this.after_.unshift(a)};jasmine.Suite.prototype.results=function(){return this.queue.results()};
jasmine.Suite.prototype.add=function(a){this.children_.push(a);a instanceof jasmine.Suite?(this.suites_.push(a),this.env.currentRunner().addSuite(a)):this.specs_.push(a);this.queue.add(a)};jasmine.Suite.prototype.specs=function(){return this.specs_};jasmine.Suite.prototype.suites=function(){return this.suites_};jasmine.Suite.prototype.children=function(){return this.children_};jasmine.Suite.prototype.execute=function(a){var b=this;this.queue.start(function(){b.finish(a)})};
jasmine.WaitsBlock=function(a,b,c){this.timeout=b;jasmine.Block.call(this,a,null,c)};jasmine.util.inherit(jasmine.WaitsBlock,jasmine.Block);jasmine.WaitsBlock.prototype.execute=function(a){this.env.reporter.log(">> Jasmine waiting for "+this.timeout+" ms...");this.env.setTimeout(function(){a()},this.timeout)};jasmine.WaitsForBlock=function(a,b,c,d,e){this.timeout=b||a.defaultTimeoutInterval;this.latchFunction=c;this.message=d;this.totalTimeSpentWaitingForLatch=0;jasmine.Block.call(this,a,null,e)};
jasmine.util.inherit(jasmine.WaitsForBlock,jasmine.Block);jasmine.WaitsForBlock.TIMEOUT_INCREMENT=10;
jasmine.WaitsForBlock.prototype.execute=function(a){this.env.reporter.log(">> Jasmine waiting for "+(this.message||"something to happen"));var b;try{b=this.latchFunction.apply(this.spec)}catch(c){this.spec.fail(c);a();return}if(b)a();else if(this.totalTimeSpentWaitingForLatch>=this.timeout)this.spec.fail({name:"timeout",message:"timed out after "+this.timeout+" msec waiting for "+(this.message||"something to happen")}),this.abort=!0,a();else{this.totalTimeSpentWaitingForLatch+=jasmine.WaitsForBlock.TIMEOUT_INCREMENT;
var d=this;this.env.setTimeout(function(){d.execute(a)},jasmine.WaitsForBlock.TIMEOUT_INCREMENT)}};jasmine.FakeTimer=function(){this.reset();var a=this;a.setTimeout=function(b,c){a.timeoutsMade++;a.scheduleFunction(a.timeoutsMade,b,c,!1);return a.timeoutsMade};a.setInterval=function(b,c){a.timeoutsMade++;a.scheduleFunction(a.timeoutsMade,b,c,!0);return a.timeoutsMade};a.clearTimeout=function(b){a.scheduledFunctions[b]=jasmine.undefined};a.clearInterval=function(b){a.scheduledFunctions[b]=jasmine.undefined}};
jasmine.FakeTimer.prototype.reset=function(){this.timeoutsMade=0;this.scheduledFunctions={};this.nowMillis=0};jasmine.FakeTimer.prototype.tick=function(a){var b=this.nowMillis,a=b+a;this.runFunctionsWithinRange(b,a);this.nowMillis=a};
jasmine.FakeTimer.prototype.runFunctionsWithinRange=function(a,b){var c,d=[],e;for(e in this.scheduledFunctions)c=this.scheduledFunctions[e],c!=jasmine.undefined&&(c.runAtMillis>=a&&c.runAtMillis<=b)&&(d.push(c),this.scheduledFunctions[e]=jasmine.undefined);if(0<d.length){d.sort(function(a,b){return a.runAtMillis-b.runAtMillis});for(c=0;c<d.length;++c)try{var f=d[c];this.nowMillis=f.runAtMillis;f.funcToCall();f.recurring&&this.scheduleFunction(f.timeoutKey,f.funcToCall,f.millis,!0)}catch(g){}this.runFunctionsWithinRange(a,
b)}};jasmine.FakeTimer.prototype.scheduleFunction=function(a,b,c,d){this.scheduledFunctions[a]={runAtMillis:this.nowMillis+c,funcToCall:b,recurring:d,timeoutKey:a,millis:c}};
jasmine.Clock={defaultFakeTimer:new jasmine.FakeTimer,reset:function(){jasmine.Clock.assertInstalled();jasmine.Clock.defaultFakeTimer.reset()},tick:function(a){jasmine.Clock.assertInstalled();jasmine.Clock.defaultFakeTimer.tick(a)},runFunctionsWithinRange:function(a,b){jasmine.Clock.defaultFakeTimer.runFunctionsWithinRange(a,b)},scheduleFunction:function(a,b,c,d){jasmine.Clock.defaultFakeTimer.scheduleFunction(a,b,c,d)},useMock:function(){jasmine.Clock.isInstalled()||(jasmine.getEnv().currentSpec.after(jasmine.Clock.uninstallMock),
jasmine.Clock.installMock())},installMock:function(){jasmine.Clock.installed=jasmine.Clock.defaultFakeTimer},uninstallMock:function(){jasmine.Clock.assertInstalled();jasmine.Clock.installed=jasmine.Clock.real},real:{setTimeout:jasmine.getGlobal().setTimeout,clearTimeout:jasmine.getGlobal().clearTimeout,setInterval:jasmine.getGlobal().setInterval,clearInterval:jasmine.getGlobal().clearInterval},assertInstalled:function(){if(!jasmine.Clock.isInstalled())throw Error("Mock clock is not installed, use jasmine.Clock.useMock()");
},isInstalled:function(){return jasmine.Clock.installed==jasmine.Clock.defaultFakeTimer},installed:null};jasmine.Clock.installed=jasmine.Clock.real;jasmine.getGlobal().setTimeout=function(a,b){return jasmine.Clock.installed.setTimeout.apply?jasmine.Clock.installed.setTimeout.apply(this,arguments):jasmine.Clock.installed.setTimeout(a,b)};
jasmine.getGlobal().setInterval=function(a,b){return jasmine.Clock.installed.setInterval.apply?jasmine.Clock.installed.setInterval.apply(this,arguments):jasmine.Clock.installed.setInterval(a,b)};jasmine.getGlobal().clearTimeout=function(a){return jasmine.Clock.installed.clearTimeout.apply?jasmine.Clock.installed.clearTimeout.apply(this,arguments):jasmine.Clock.installed.clearTimeout(a)};
jasmine.getGlobal().clearInterval=function(a){return jasmine.Clock.installed.clearTimeout.apply?jasmine.Clock.installed.clearInterval.apply(this,arguments):jasmine.Clock.installed.clearInterval(a)};jasmine.version_={major:1,minor:0,build:1,revision:1286311016};