diff options
| -rw-r--r-- | src/Angular.js | 2 | ||||
| -rw-r--r-- | src/angular-mocks.js | 5 | ||||
| -rw-r--r-- | src/filters.js | 2 | ||||
| -rw-r--r-- | src/parser.js | 2 | ||||
| -rw-r--r-- | test/scenario/output/HtmlSpec.js | 3 | ||||
| -rw-r--r-- | test/service/deferSpec.js | 16 | ||||
| -rw-r--r-- | test/service/xhr.cacheSpec.js | 12 | ||||
| -rw-r--r-- | test/testabilityPatch.js | 9 | 
8 files changed, 24 insertions, 27 deletions
| diff --git a/src/Angular.js b/src/Angular.js index f28789d5..295be998 100644 --- a/src/Angular.js +++ b/src/Angular.js @@ -115,7 +115,7 @@ var _undefined        = undefined,      angularCallbacks  = extensionMap(angular, 'callbacks'),      nodeName_,      rngScript         = /^(|.*\/)angular(-.*?)?(\.min)?.js(\?[^#]*)?(#(.*))?$/, -    uid               = ['0', '0', '0']; +    uid               = ['0', '0', '0'],      DATE_ISOSTRING_LN = 24;  /** diff --git a/src/angular-mocks.js b/src/angular-mocks.js index 9154f8b5..2590c122 100644 --- a/src/angular-mocks.js +++ b/src/angular-mocks.js @@ -523,7 +523,8 @@ function TzDate(offset, timestamp) {    };    //hide all methods not implemented in this mock that the Date prototype exposes -  var unimplementedMethods = ['getMilliseconds', 'getTime', 'getUTCDay', +  var self = this, +      unimplementedMethods = ['getMilliseconds', 'getUTCDay',        'getUTCMilliseconds', 'getYear', 'setDate', 'setFullYear', 'setHours', 'setMilliseconds',        'setMinutes', 'setMonth', 'setSeconds', 'setTime', 'setUTCDate', 'setUTCFullYear',        'setUTCHours', 'setUTCMilliseconds', 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', @@ -531,7 +532,7 @@ function TzDate(offset, timestamp) {        'toLocaleTimeString', 'toSource', 'toString', 'toTimeString', 'toUTCString', 'valueOf'];    angular.forEach(unimplementedMethods, function(methodName) { -    this[methodName] = function() { +    self[methodName] = function() {        throw {          name: "MethodNotImplemented",          message: "Method '" + methodName + "' is not implemented in the TzDate mock" diff --git a/src/filters.js b/src/filters.js index 491bb88e..f2cff14d 100644 --- a/src/filters.js +++ b/src/filters.js @@ -114,7 +114,7 @@ angularFilter.number = function(number, fractionSize){        pow = Math.pow(10, fractionSize),        whole = '' + number,        formatedText = '', -      i; +      i, fraction;    if (whole.indexOf('e') > -1) return whole; diff --git a/src/parser.js b/src/parser.js index 0c4a391a..541addc4 100644 --- a/src/parser.js +++ b/src/parser.js @@ -290,11 +290,9 @@ function parser(text, json){      var token = peek(e1, e2, e3, e4);      if (token) {        if (json && !token.json) { -        index = token.index;          throwError("is not valid json", token);        }        tokens.shift(); -      this.currentToken = token;        return token;      }      return false; diff --git a/test/scenario/output/HtmlSpec.js b/test/scenario/output/HtmlSpec.js index a1ebef39..1cfa268e 100644 --- a/test/scenario/output/HtmlSpec.js +++ b/test/scenario/output/HtmlSpec.js @@ -1,6 +1,5 @@  describe('angular.scenario.output.html', function() { -  var runner, model, spec, listeners; -  var ui, context; +  var runner, model, spec, step, listeners, ui, context;    beforeEach(function() {      listeners = []; diff --git a/test/service/deferSpec.js b/test/service/deferSpec.js index bd8fe7d7..21b8bf9c 100644 --- a/test/service/deferSpec.js +++ b/test/service/deferSpec.js @@ -40,31 +40,31 @@ describe('$defer', function() {    it('should call eval after each callback is executed', function() { -    var eval = this.spyOn(scope, '$eval').andCallThrough(); +    var evalSpy = this.spyOn(scope, '$eval').andCallThrough();      $defer(function() {}); -    expect(eval).not.toHaveBeenCalled(); +    expect(evalSpy).not.toHaveBeenCalled();      $browser.defer.flush(); -    expect(eval).toHaveBeenCalled(); +    expect(evalSpy).toHaveBeenCalled(); -    eval.reset(); //reset the spy; +    evalSpy.reset(); //reset the spy;      $defer(function() {});      $defer(function() {});      $browser.defer.flush(); -    expect(eval.callCount).toBe(2); +    expect(evalSpy.callCount).toBe(2);    });    it('should call eval even if an exception is thrown in callback', function() { -    var eval = this.spyOn(scope, '$eval').andCallThrough(); +    var evalSpy = this.spyOn(scope, '$eval').andCallThrough();      $defer(function() {throw "Test Error";}); -    expect(eval).not.toHaveBeenCalled(); +    expect(evalSpy).not.toHaveBeenCalled();      $browser.defer.flush(); -    expect(eval).toHaveBeenCalled(); +    expect(evalSpy).toHaveBeenCalled();    });    it('should allow you to specify the delay time', function(){ diff --git a/test/service/xhr.cacheSpec.js b/test/service/xhr.cacheSpec.js index ecaebc3f..4d3e3e08 100644 --- a/test/service/xhr.cacheSpec.js +++ b/test/service/xhr.cacheSpec.js @@ -124,21 +124,21 @@ describe('$xhr.cache', function() {    it('should call eval after callbacks for both cache hit and cache miss execute', function() { -    var eval = this.spyOn(scope, '$eval').andCallThrough(); +    var evalSpy = this.spyOn(scope, '$eval').andCallThrough();      $browserXhr.expectGET('/url').respond('+');      cache('GET', '/url', null, callback); -    expect(eval).not.toHaveBeenCalled(); +    expect(evalSpy).not.toHaveBeenCalled();      $browserXhr.flush(); -    expect(eval).toHaveBeenCalled(); +    expect(evalSpy).toHaveBeenCalled(); -    eval.reset(); //reset the spy +    evalSpy.reset(); //reset the spy      cache('GET', '/url', null, callback); -    expect(eval).not.toHaveBeenCalled(); +    expect(evalSpy).not.toHaveBeenCalled();      $browser.defer.flush(); -    expect(eval).toHaveBeenCalled(); +    expect(evalSpy).toHaveBeenCalled();    });  }); diff --git a/test/testabilityPatch.js b/test/testabilityPatch.js index 34e1710b..375e01c7 100644 --- a/test/testabilityPatch.js +++ b/test/testabilityPatch.js @@ -8,7 +8,7 @@ _jQuery.event.special.change = undefined;  if (window.jstestdriver) { -  jstd = jstestdriver; +  window.jstd = jstestdriver;    window.dump = function(){      var args = [];      forEach(arguments, function(arg){ @@ -175,8 +175,7 @@ extend(angular, {    'isFunction': isFunction,    'isObject': isObject,    'isNumber': isNumber, -  'isArray': isArray, -  'forEach': forEach +  'isArray': isArray  }); @@ -317,8 +316,8 @@ function assertThrows(error, fn){    assertEquals(error, exception);  } -log = noop; -error = noop; +window.log = noop; +window.error = noop;  function rethrow(e) {    if(e) { | 
