angular-gem 1.2.18.1 → 1.2.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.18
2
+ * @license AngularJS v1.2.19
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.18
2
+ * @license AngularJS v1.2.19
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.18
2
+ * @license AngularJS v1.2.19
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -69,7 +69,7 @@ function minErr(module) {
69
69
  return match;
70
70
  });
71
71
 
72
- message = message + '\nhttp://errors.angularjs.org/1.2.18/' +
72
+ message = message + '\nhttp://errors.angularjs.org/1.2.19/' +
73
73
  (module ? module + '/' : '') + code;
74
74
  for (i = 2; i < arguments.length; i++) {
75
75
  message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.18
2
+ * @license AngularJS v1.2.19
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -462,7 +462,7 @@ angular.mock.$IntervalProvider = function() {
462
462
  iteration = 0,
463
463
  skipApply = (angular.isDefined(invokeApply) && !invokeApply);
464
464
 
465
- count = (angular.isDefined(count)) ? count : 0,
465
+ count = (angular.isDefined(count)) ? count : 0;
466
466
  promise.then(null, null, fn);
467
467
 
468
468
  promise.$$intervalId = nextRepeatId;
@@ -1726,7 +1726,7 @@ angular.mock.$RootElementProvider = function() {
1726
1726
  *
1727
1727
  * # ngMock
1728
1728
  *
1729
- * The `ngMock` module providers support to inject and mock Angular services into unit tests.
1729
+ * The `ngMock` module provides support to inject and mock Angular services into unit tests.
1730
1730
  * In addition, ngMock also extends various core ng services such that they can be
1731
1731
  * inspected and controlled in a synchronous manner within test code.
1732
1732
  *
@@ -1965,6 +1965,12 @@ if(window.jasmine || window.mocha) {
1965
1965
  (window.afterEach || window.teardown)(function() {
1966
1966
  var injector = currentSpec.$injector;
1967
1967
 
1968
+ angular.forEach(currentSpec.$modules, function(module) {
1969
+ if (module && module.$$hashKey) {
1970
+ module.$$hashKey = undefined;
1971
+ }
1972
+ });
1973
+
1968
1974
  currentSpec.$injector = null;
1969
1975
  currentSpec.$modules = null;
1970
1976
  currentSpec = null;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.18
2
+ * @license AngularJS v1.2.19
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.18
2
+ * @license AngularJS v1.2.19
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license AngularJS v1.2.18
2
+ * @license AngularJS v1.2.19
3
3
  * (c) 2010-2014 Google, Inc. http://angularjs.org
4
4
  * License: MIT
5
5
  */
@@ -9790,7 +9790,7 @@ if ( typeof module === "object" && module && typeof module.exports === "object"
9790
9790
  })( window );
9791
9791
 
9792
9792
  /**
9793
- * @license AngularJS v1.2.18
9793
+ * @license AngularJS v1.2.19
9794
9794
  * (c) 2010-2014 Google, Inc. http://angularjs.org
9795
9795
  * License: MIT
9796
9796
  */
@@ -9860,7 +9860,7 @@ function minErr(module) {
9860
9860
  return match;
9861
9861
  });
9862
9862
 
9863
- message = message + '\nhttp://errors.angularjs.org/1.2.18/' +
9863
+ message = message + '\nhttp://errors.angularjs.org/1.2.19/' +
9864
9864
  (module ? module + '/' : '') + code;
9865
9865
  for (i = 2; i < arguments.length; i++) {
9866
9866
  message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -9884,6 +9884,7 @@ function minErr(module) {
9884
9884
  -angularModule,
9885
9885
  -nodeName_,
9886
9886
  -uid,
9887
+ -VALIDITY_STATE_PROPERTY,
9887
9888
 
9888
9889
  -lowercase,
9889
9890
  -uppercase,
@@ -9973,6 +9974,10 @@ function minErr(module) {
9973
9974
  * <div doc-module-components="ng"></div>
9974
9975
  */
9975
9976
 
9977
+ // The name of a form control's ValidityState property.
9978
+ // This is used so that it's possible for internal tests to create mock ValidityStates.
9979
+ var VALIDITY_STATE_PROPERTY = 'validity';
9980
+
9976
9981
  /**
9977
9982
  * @ngdoc function
9978
9983
  * @name angular.lowercase
@@ -11145,7 +11150,7 @@ function angularInit(element, bootstrap) {
11145
11150
  *
11146
11151
  * Angular will detect if it has been loaded into the browser more than once and only allow the
11147
11152
  * first loaded script to be bootstrapped and will report a warning to the browser console for
11148
- * each of the subsequent scripts. This prevents strange results in applications, where otherwise
11153
+ * each of the subsequent scripts. This prevents strange results in applications, where otherwise
11149
11154
  * multiple instances of Angular try to work on the DOM.
11150
11155
  *
11151
11156
  * <example name="multi-bootstrap" module="multi-bootstrap">
@@ -11275,7 +11280,7 @@ function assertArgFn(arg, name, acceptArrayAnnotation) {
11275
11280
  }
11276
11281
 
11277
11282
  assertArg(isFunction(arg), name, 'not a function, got ' +
11278
- (arg && typeof arg == 'object' ? arg.constructor.name || 'Object' : typeof arg));
11283
+ (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
11279
11284
  return arg;
11280
11285
  }
11281
11286
 
@@ -11745,11 +11750,11 @@ function setupModuleLoader(window) {
11745
11750
  * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
11746
11751
  */
11747
11752
  var version = {
11748
- full: '1.2.18', // all of these placeholder strings will be replaced by grunt's
11753
+ full: '1.2.19', // all of these placeholder strings will be replaced by grunt's
11749
11754
  major: 1, // package task
11750
11755
  minor: 2,
11751
- dot: 18,
11752
- codeName: 'ear-extendability'
11756
+ dot: 19,
11757
+ codeName: 'precognitive-flashbacks'
11753
11758
  };
11754
11759
 
11755
11760
 
@@ -11971,8 +11976,9 @@ function publishExternalAPI(angular){
11971
11976
  * @returns {Object} jQuery object.
11972
11977
  */
11973
11978
 
11979
+ JQLite.expando = 'ng339';
11980
+
11974
11981
  var jqCache = JQLite.cache = {},
11975
- jqName = JQLite.expando = 'ng' + new Date().getTime(),
11976
11982
  jqId = 1,
11977
11983
  addEventListenerFn = (window.document.addEventListener
11978
11984
  ? function(element, type, fn) {element.addEventListener(type, fn, false);}
@@ -12182,7 +12188,7 @@ function jqLiteOff(element, type, fn, unsupported) {
12182
12188
  }
12183
12189
 
12184
12190
  function jqLiteRemoveData(element, name) {
12185
- var expandoId = element[jqName],
12191
+ var expandoId = element.ng339,
12186
12192
  expandoStore = jqCache[expandoId];
12187
12193
 
12188
12194
  if (expandoStore) {
@@ -12196,17 +12202,17 @@ function jqLiteRemoveData(element, name) {
12196
12202
  jqLiteOff(element);
12197
12203
  }
12198
12204
  delete jqCache[expandoId];
12199
- element[jqName] = undefined; // ie does not allow deletion of attributes on elements.
12205
+ element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it
12200
12206
  }
12201
12207
  }
12202
12208
 
12203
12209
  function jqLiteExpandoStore(element, key, value) {
12204
- var expandoId = element[jqName],
12210
+ var expandoId = element.ng339,
12205
12211
  expandoStore = jqCache[expandoId || -1];
12206
12212
 
12207
12213
  if (isDefined(value)) {
12208
12214
  if (!expandoStore) {
12209
- element[jqName] = expandoId = jqNextId();
12215
+ element.ng339 = expandoId = jqNextId();
12210
12216
  expandoStore = jqCache[expandoId] = {};
12211
12217
  }
12212
12218
  expandoStore[key] = value;
@@ -12873,16 +12879,16 @@ forEach({
12873
12879
  * @returns {string} hash string such that the same input will have the same hash string.
12874
12880
  * The resulting string key is in 'type:hashKey' format.
12875
12881
  */
12876
- function hashKey(obj) {
12882
+ function hashKey(obj, nextUidFn) {
12877
12883
  var objType = typeof obj,
12878
12884
  key;
12879
12885
 
12880
- if (objType == 'object' && obj !== null) {
12886
+ if (objType == 'function' || (objType == 'object' && obj !== null)) {
12881
12887
  if (typeof (key = obj.$$hashKey) == 'function') {
12882
12888
  // must invoke on object to keep the right this
12883
12889
  key = obj.$$hashKey();
12884
12890
  } else if (key === undefined) {
12885
- key = obj.$$hashKey = nextUid();
12891
+ key = obj.$$hashKey = (nextUidFn || nextUid)();
12886
12892
  }
12887
12893
  } else {
12888
12894
  key = obj;
@@ -12894,7 +12900,13 @@ function hashKey(obj) {
12894
12900
  /**
12895
12901
  * HashMap which can use objects as keys
12896
12902
  */
12897
- function HashMap(array){
12903
+ function HashMap(array, isolatedUid) {
12904
+ if (isolatedUid) {
12905
+ var uid = 0;
12906
+ this.nextUid = function() {
12907
+ return ++uid;
12908
+ };
12909
+ }
12898
12910
  forEach(array, this.put, this);
12899
12911
  }
12900
12912
  HashMap.prototype = {
@@ -12904,7 +12916,7 @@ HashMap.prototype = {
12904
12916
  * @param value value to store can be any type
12905
12917
  */
12906
12918
  put: function(key, value) {
12907
- this[hashKey(key)] = value;
12919
+ this[hashKey(key, this.nextUid)] = value;
12908
12920
  },
12909
12921
 
12910
12922
  /**
@@ -12912,7 +12924,7 @@ HashMap.prototype = {
12912
12924
  * @returns {Object} the value for the key
12913
12925
  */
12914
12926
  get: function(key) {
12915
- return this[hashKey(key)];
12927
+ return this[hashKey(key, this.nextUid)];
12916
12928
  },
12917
12929
 
12918
12930
  /**
@@ -12920,7 +12932,7 @@ HashMap.prototype = {
12920
12932
  * @param key
12921
12933
  */
12922
12934
  remove: function(key) {
12923
- var value = this[key = hashKey(key)];
12935
+ var value = this[key = hashKey(key, this.nextUid)];
12924
12936
  delete this[key];
12925
12937
  return value;
12926
12938
  }
@@ -12998,7 +13010,7 @@ function annotate(fn) {
12998
13010
  argDecl,
12999
13011
  last;
13000
13012
 
13001
- if (typeof fn == 'function') {
13013
+ if (typeof fn === 'function') {
13002
13014
  if (!($inject = fn.$inject)) {
13003
13015
  $inject = [];
13004
13016
  if (fn.length) {
@@ -13211,7 +13223,7 @@ function annotate(fn) {
13211
13223
 
13212
13224
 
13213
13225
  /**
13214
- * @ngdoc object
13226
+ * @ngdoc service
13215
13227
  * @name $provide
13216
13228
  *
13217
13229
  * @description
@@ -13517,7 +13529,7 @@ function createInjector(modulesToLoad) {
13517
13529
  var INSTANTIATING = {},
13518
13530
  providerSuffix = 'Provider',
13519
13531
  path = [],
13520
- loadedModules = new HashMap(),
13532
+ loadedModules = new HashMap([], true),
13521
13533
  providerCache = {
13522
13534
  $provide: {
13523
13535
  provider: supportObject(provider),
@@ -13688,8 +13700,7 @@ function createInjector(modulesToLoad) {
13688
13700
  : getService(key)
13689
13701
  );
13690
13702
  }
13691
- if (!fn.$inject) {
13692
- // this means that we must be an array.
13703
+ if (isArray(fn)) {
13693
13704
  fn = fn[length];
13694
13705
  }
13695
13706
 
@@ -15870,7 +15881,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
15870
15881
  directiveNormalize(nodeName_(node).toLowerCase()), 'E', maxPriority, ignoreDirective);
15871
15882
 
15872
15883
  // iterate over the attributes
15873
- for (var attr, name, nName, ngAttrName, value, nAttrs = node.attributes,
15884
+ for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,
15874
15885
  j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {
15875
15886
  var attrStartName = false;
15876
15887
  var attrEndName = false;
@@ -15878,9 +15889,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
15878
15889
  attr = nAttrs[j];
15879
15890
  if (!msie || msie >= 8 || attr.specified) {
15880
15891
  name = attr.name;
15892
+ value = trim(attr.value);
15893
+
15881
15894
  // support ngAttr attribute binding
15882
15895
  ngAttrName = directiveNormalize(name);
15883
- if (NG_ATTR_BINDING.test(ngAttrName)) {
15896
+ if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) {
15884
15897
  name = snake_case(ngAttrName.substr(6), '-');
15885
15898
  }
15886
15899
 
@@ -15893,9 +15906,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
15893
15906
 
15894
15907
  nName = directiveNormalize(name.toLowerCase());
15895
15908
  attrsMap[nName] = name;
15896
- attrs[nName] = value = trim(attr.value);
15897
- if (getBooleanAttrName(node, nName)) {
15898
- attrs[nName] = true; // presence means true
15909
+ if (isNgAttr || !attrs.hasOwnProperty(nName)) {
15910
+ attrs[nName] = value;
15911
+ if (getBooleanAttrName(node, nName)) {
15912
+ attrs[nName] = true; // presence means true
15913
+ }
15899
15914
  }
15900
15915
  addAttrInterpolateDirective(node, directives, value, nName);
15901
15916
  addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,
@@ -16993,7 +17008,7 @@ function $ControllerProvider() {
16993
17008
  instance = $injector.instantiate(expression, locals);
16994
17009
 
16995
17010
  if (identifier) {
16996
- if (!(locals && typeof locals.$scope == 'object')) {
17011
+ if (!(locals && typeof locals.$scope === 'object')) {
16997
17012
  throw minErr('$controller')('noscp',
16998
17013
  "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",
16999
17014
  constructor || expression.name, identifier);
@@ -18195,7 +18210,8 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
18195
18210
  // Safari respectively.
18196
18211
  if (xhr && xhr.readyState == 4) {
18197
18212
  var responseHeaders = null,
18198
- response = null;
18213
+ response = null,
18214
+ statusText = '';
18199
18215
 
18200
18216
  if(status !== ABORTED) {
18201
18217
  responseHeaders = xhr.getAllResponseHeaders();
@@ -18205,11 +18221,17 @@ function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDoc
18205
18221
  response = ('response' in xhr) ? xhr.response : xhr.responseText;
18206
18222
  }
18207
18223
 
18224
+ // Accessing statusText on an aborted xhr object will
18225
+ // throw an 'c00c023f error' in IE9 and lower, don't touch it.
18226
+ if (!(status === ABORTED && msie < 10)) {
18227
+ statusText = xhr.statusText;
18228
+ }
18229
+
18208
18230
  completeRequest(callback,
18209
18231
  status || xhr.status,
18210
18232
  response,
18211
18233
  responseHeaders,
18212
- xhr.statusText || '');
18234
+ statusText);
18213
18235
  }
18214
18236
  };
18215
18237
 
@@ -18743,7 +18765,7 @@ function $IntervalProvider() {
18743
18765
  interval.cancel = function(promise) {
18744
18766
  if (promise && promise.$$intervalId in intervals) {
18745
18767
  intervals[promise.$$intervalId].reject('canceled');
18746
- clearInterval(promise.$$intervalId);
18768
+ $window.clearInterval(promise.$$intervalId);
18747
18769
  delete intervals[promise.$$intervalId];
18748
18770
  return true;
18749
18771
  }
@@ -19377,7 +19399,7 @@ function $LocationProvider(){
19377
19399
  html5Mode = false;
19378
19400
 
19379
19401
  /**
19380
- * @ngdoc property
19402
+ * @ngdoc method
19381
19403
  * @name $locationProvider#hashPrefix
19382
19404
  * @description
19383
19405
  * @param {string=} prefix Prefix for hash part (containing path and search)
@@ -19393,7 +19415,7 @@ function $LocationProvider(){
19393
19415
  };
19394
19416
 
19395
19417
  /**
19396
- * @ngdoc property
19418
+ * @ngdoc method
19397
19419
  * @name $locationProvider#html5Mode
19398
19420
  * @description
19399
19421
  * @param {boolean=} mode Use HTML5 strategy if available.
@@ -19751,14 +19773,7 @@ var promiseWarning;
19751
19773
  //
19752
19774
  // As an example, consider the following Angular expression:
19753
19775
  //
19754
- // {}.toString.constructor(alert("evil JS code"))
19755
- //
19756
- // We want to prevent this type of access. For the sake of performance, during the lexing phase we
19757
- // disallow any "dotted" access to any member named "constructor".
19758
- //
19759
- // For reflective calls (a[b]) we check that the value of the lookup is not the Function constructor
19760
- // while evaluating the expression, which is a stronger but more expensive test. Since reflective
19761
- // calls are expensive anyway, this is not such a big deal compared to static dereferencing.
19776
+ // {}.toString.constructor('alert("evil JS code")')
19762
19777
  //
19763
19778
  // This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits
19764
19779
  // against the expression language, but not to prevent exploits that were enabled by exposing
@@ -19766,17 +19781,19 @@ var promiseWarning;
19766
19781
  // practice and therefore we are not even trying to protect against interaction with an object
19767
19782
  // explicitly exposed in this way.
19768
19783
  //
19769
- // A developer could foil the name check by aliasing the Function constructor under a different
19770
- // name on the scope.
19771
- //
19772
19784
  // In general, it is not possible to access a Window object from an angular expression unless a
19773
19785
  // window or some DOM object that has a reference to window is published onto a Scope.
19786
+ // Similarly we prevent invocations of function known to be dangerous, as well as assignments to
19787
+ // native objects.
19788
+
19774
19789
 
19775
19790
  function ensureSafeMemberName(name, fullExpression) {
19776
- if (name === "constructor") {
19791
+ if (name === "__defineGetter__" || name === "__defineSetter__"
19792
+ || name === "__lookupGetter__" || name === "__lookupSetter__"
19793
+ || name === "__proto__") {
19777
19794
  throw $parseMinErr('isecfld',
19778
- 'Referencing "constructor" field in Angular expressions is disallowed! Expression: {0}',
19779
- fullExpression);
19795
+ 'Attempting to access a disallowed field in Angular expressions! '
19796
+ +'Expression: {0}', fullExpression);
19780
19797
  }
19781
19798
  return name;
19782
19799
  }
@@ -19798,11 +19815,34 @@ function ensureSafeObject(obj, fullExpression) {
19798
19815
  throw $parseMinErr('isecdom',
19799
19816
  'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',
19800
19817
  fullExpression);
19818
+ } else if (// block Object so that we can't get hold of dangerous Object.* methods
19819
+ obj === Object) {
19820
+ throw $parseMinErr('isecobj',
19821
+ 'Referencing Object in Angular expressions is disallowed! Expression: {0}',
19822
+ fullExpression);
19801
19823
  }
19802
19824
  }
19803
19825
  return obj;
19804
19826
  }
19805
19827
 
19828
+ var CALL = Function.prototype.call;
19829
+ var APPLY = Function.prototype.apply;
19830
+ var BIND = Function.prototype.bind;
19831
+
19832
+ function ensureSafeFunction(obj, fullExpression) {
19833
+ if (obj) {
19834
+ if (obj.constructor === obj) {
19835
+ throw $parseMinErr('isecfn',
19836
+ 'Referencing Function in Angular expressions is disallowed! Expression: {0}',
19837
+ fullExpression);
19838
+ } else if (obj === CALL || obj === APPLY || (BIND && obj === BIND)) {
19839
+ throw $parseMinErr('isecff',
19840
+ 'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}',
19841
+ fullExpression);
19842
+ }
19843
+ }
19844
+ }
19845
+
19806
19846
  var OPERATORS = {
19807
19847
  /* jshint bitwise : false */
19808
19848
  'null':function(){return null;},
@@ -20437,6 +20477,7 @@ Parser.prototype = {
20437
20477
  i = indexFn(self, locals),
20438
20478
  v, p;
20439
20479
 
20480
+ ensureSafeMemberName(i, parser.text);
20440
20481
  if (!o) return undefined;
20441
20482
  v = ensureSafeObject(o[i], parser.text);
20442
20483
  if (v && v.then && parser.options.unwrapPromises) {
@@ -20479,7 +20520,7 @@ Parser.prototype = {
20479
20520
  var fnPtr = fn(scope, locals, context) || noop;
20480
20521
 
20481
20522
  ensureSafeObject(context, parser.text);
20482
- ensureSafeObject(fnPtr, parser.text);
20523
+ ensureSafeFunction(fnPtr, parser.text);
20483
20524
 
20484
20525
  // IE stupidity! (IE doesn't have apply for some native functions)
20485
20526
  var v = fnPtr.apply
@@ -20588,6 +20629,8 @@ function setter(obj, path, setValue, fullExp, options) {
20588
20629
  }
20589
20630
  }
20590
20631
  key = ensureSafeMemberName(element.shift(), fullExp);
20632
+ ensureSafeObject(obj, fullExp);
20633
+ ensureSafeObject(obj[key], fullExp);
20591
20634
  obj[key] = setValue;
20592
20635
  return setValue;
20593
20636
  }
@@ -21007,17 +21050,13 @@ function $ParseProvider() {
21007
21050
  * var deferred = $q.defer();
21008
21051
  *
21009
21052
  * setTimeout(function() {
21010
- * // since this fn executes async in a future turn of the event loop, we need to wrap
21011
- * // our code into an $apply call so that the model changes are properly observed.
21012
- * scope.$apply(function() {
21013
- * deferred.notify('About to greet ' + name + '.');
21014
- *
21015
- * if (okToGreet(name)) {
21016
- * deferred.resolve('Hello, ' + name + '!');
21017
- * } else {
21018
- * deferred.reject('Greeting ' + name + ' is not allowed.');
21019
- * }
21020
- * });
21053
+ * deferred.notify('About to greet ' + name + '.');
21054
+ *
21055
+ * if (okToGreet(name)) {
21056
+ * deferred.resolve('Hello, ' + name + '!');
21057
+ * } else {
21058
+ * deferred.reject('Greeting ' + name + ' is not allowed.');
21059
+ * }
21021
21060
  * }, 1000);
21022
21061
  *
21023
21062
  * return deferred.promise;
@@ -22179,7 +22218,7 @@ function $RootScopeProvider(){
22179
22218
  if ((value = watch.get(current)) !== (last = watch.last) &&
22180
22219
  !(watch.eq
22181
22220
  ? equals(value, last)
22182
- : (typeof value == 'number' && typeof last == 'number'
22221
+ : (typeof value === 'number' && typeof last === 'number'
22183
22222
  && isNaN(value) && isNaN(last)))) {
22184
22223
  dirty = true;
22185
22224
  lastDirtyWatch = watch;
@@ -23524,7 +23563,7 @@ function $SceProvider() {
23524
23563
 
23525
23564
  /**
23526
23565
  * @ngdoc method
23527
- * @name $sce#parse
23566
+ * @name $sce#parseAs
23528
23567
  *
23529
23568
  * @description
23530
23569
  * Converts Angular {@link guide/expression expression} into a function. This is like {@link
@@ -24480,7 +24519,7 @@ function filterFilter() {
24480
24519
  // jshint +W086
24481
24520
  for (var key in expression) {
24482
24521
  (function(path) {
24483
- if (typeof expression[path] == 'undefined') return;
24522
+ if (typeof expression[path] === 'undefined') return;
24484
24523
  predicates.push(function(value) {
24485
24524
  return search(path == '$' ? value : (value && value[path]), expression[path]);
24486
24525
  });
@@ -24635,6 +24674,7 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
24635
24674
  var match = numStr.match(/([\d\.]+)e(-?)(\d+)/);
24636
24675
  if (match && match[2] == '-' && match[3] > fractionSize + 1) {
24637
24676
  numStr = '0';
24677
+ number = 0;
24638
24678
  } else {
24639
24679
  formatedText = numStr;
24640
24680
  hasExponent = true;
@@ -24649,8 +24689,11 @@ function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
24649
24689
  fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac);
24650
24690
  }
24651
24691
 
24652
- var pow = Math.pow(10, fractionSize + 1);
24653
- number = Math.floor(number * pow + 5) / pow;
24692
+ // safely round numbers in JS without hitting imprecisions of floating-point arithmetics
24693
+ // inspired by:
24694
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
24695
+ number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize);
24696
+
24654
24697
  var fraction = ('' + number).split(DECIMAL_SEP);
24655
24698
  var whole = fraction[0];
24656
24699
  fraction = fraction[1] || '';
@@ -26152,7 +26195,7 @@ var ngFormDirective = formDirectiveFactory(true);
26152
26195
  */
26153
26196
 
26154
26197
  var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
26155
- var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i;
26198
+ var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9-]+(\.[a-z0-9-]+)*$/i;
26156
26199
  var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/;
26157
26200
 
26158
26201
  var inputType = {
@@ -26578,15 +26621,29 @@ function validate(ctrl, validatorName, validity, value){
26578
26621
  return validity ? value : undefined;
26579
26622
  }
26580
26623
 
26624
+ function testFlags(validity, flags) {
26625
+ var i, flag;
26626
+ if (flags) {
26627
+ for (i=0; i<flags.length; ++i) {
26628
+ flag = flags[i];
26629
+ if (validity[flag]) {
26630
+ return true;
26631
+ }
26632
+ }
26633
+ }
26634
+ return false;
26635
+ }
26581
26636
 
26582
- function addNativeHtml5Validators(ctrl, validatorName, element) {
26583
- var validity = element.prop('validity');
26637
+ // Pass validity so that behaviour can be mocked easier.
26638
+ function addNativeHtml5Validators(ctrl, validatorName, badFlags, ignoreFlags, validity) {
26584
26639
  if (isObject(validity)) {
26640
+ ctrl.$$hasNativeValidators = true;
26585
26641
  var validator = function(value) {
26586
26642
  // Don't overwrite previous validation, don't consider valueMissing to apply (ng-required can
26587
26643
  // perform the required validation)
26588
- if (!ctrl.$error[validatorName] && (validity.badInput || validity.customError ||
26589
- validity.typeMismatch) && !validity.valueMissing) {
26644
+ if (!ctrl.$error[validatorName] &&
26645
+ !testFlags(validity, ignoreFlags) &&
26646
+ testFlags(validity, badFlags)) {
26590
26647
  ctrl.$setValidity(validatorName, false);
26591
26648
  return;
26592
26649
  }
@@ -26597,8 +26654,9 @@ function addNativeHtml5Validators(ctrl, validatorName, element) {
26597
26654
  }
26598
26655
 
26599
26656
  function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
26600
- var validity = element.prop('validity');
26657
+ var validity = element.prop(VALIDITY_STATE_PROPERTY);
26601
26658
  var placeholder = element[0].placeholder, noevent = {};
26659
+ ctrl.$$validityState = validity;
26602
26660
 
26603
26661
  // In composition mode, users are still inputing intermediate text buffer,
26604
26662
  // hold the listener until composition is done.
@@ -26636,11 +26694,11 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
26636
26694
  value = trim(value);
26637
26695
  }
26638
26696
 
26639
- if (ctrl.$viewValue !== value ||
26640
- // If the value is still empty/falsy, and there is no `required` error, run validators
26641
- // again. This enables HTML5 constraint validation errors to affect Angular validation
26642
- // even when the first character entered causes an error.
26643
- (validity && value === '' && !validity.valueMissing)) {
26697
+ // If a control is suffering from bad input, browsers discard its value, so it may be
26698
+ // necessary to revalidate even if the control's value is the same empty value twice in
26699
+ // a row.
26700
+ var revalidate = validity && ctrl.$$hasNativeValidators;
26701
+ if (ctrl.$viewValue !== value || (value === '' && revalidate)) {
26644
26702
  if (scope.$$phase) {
26645
26703
  ctrl.$setViewValue(value);
26646
26704
  } else {
@@ -26746,6 +26804,8 @@ function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
26746
26804
  }
26747
26805
  }
26748
26806
 
26807
+ var numberBadFlags = ['badInput'];
26808
+
26749
26809
  function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
26750
26810
  textInputType(scope, element, attr, ctrl, $sniffer, $browser);
26751
26811
 
@@ -26760,7 +26820,7 @@ function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
26760
26820
  }
26761
26821
  });
26762
26822
 
26763
- addNativeHtml5Validators(ctrl, 'number', element);
26823
+ addNativeHtml5Validators(ctrl, 'number', numberBadFlags, null, ctrl.$$validityState);
26764
26824
 
26765
26825
  ctrl.$formatters.push(function(value) {
26766
26826
  return ctrl.$isEmpty(value) ? '' : '' + value;
@@ -27242,7 +27302,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
27242
27302
  * This method should be called by validators - i.e. the parser or formatter functions.
27243
27303
  *
27244
27304
  * @param {string} validationErrorKey Name of the validator. the `validationErrorKey` will assign
27245
- * to `$error[validationErrorKey]=isValid` so that it is available for data-binding.
27305
+ * to `$error[validationErrorKey]=!isValid` so that it is available for data-binding.
27246
27306
  * The `validationErrorKey` should be in camelCase and will get converted into dash-case
27247
27307
  * for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`
27248
27308
  * class and can be bound to as `{{someForm.someControl.$error.myError}}` .
@@ -29626,7 +29686,7 @@ var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });
29626
29686
  * When one person, perhaps John, views the document, "John is viewing" will be shown.
29627
29687
  * When three people view the document, no explicit number rule is found, so
29628
29688
  * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.
29629
- * In this case, plural category 'one' is matched and "John, Marry and one other person are viewing"
29689
+ * In this case, plural category 'one' is matched and "John, Mary and one other person are viewing"
29630
29690
  * is shown.
29631
29691
  *
29632
29692
  * Note that when you specify offsets, you must provide explicit number rules for
@@ -30508,7 +30568,7 @@ var ngHideDirective = ['$animate', function($animate) {
30508
30568
  <file name="protractor.js" type="protractor">
30509
30569
  var colorSpan = element(by.css('span'));
30510
30570
 
30511
- iit('should check ng-style', function() {
30571
+ it('should check ng-style', function() {
30512
30572
  expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');
30513
30573
  element(by.css('input[value=\'set color\']')).click();
30514
30574
  expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)');
@@ -31401,7 +31461,7 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
31401
31461
  // rather then the element.
31402
31462
  (element = optionTemplate.clone())
31403
31463
  .val(option.id)
31404
- .attr('selected', option.selected)
31464
+ .prop('selected', option.selected)
31405
31465
  .text(option.label);
31406
31466
  }
31407
31467
 
@@ -31782,7 +31842,7 @@ _jQuery.fn.bindings = function(windowJquery, bindExp) {
31782
31842
  function push(value) {
31783
31843
  if (value === undefined) {
31784
31844
  value = '';
31785
- } else if (typeof value != 'string') {
31845
+ } else if (typeof value !== 'string') {
31786
31846
  value = angular.toJson(value);
31787
31847
  }
31788
31848
  result.push('' + value);