Skip to content
This repository was archived by the owner on May 26, 2023. It is now read-only.

Commit 52ec0a8

Browse files
chore(test): update to ng 1.2.32
1 parent 9fe7e74 commit 52ec0a8

File tree

3 files changed

+104
-59
lines changed

3 files changed

+104
-59
lines changed

test/angular/1.2/angular-animate.js

100755100644
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.2.28
2+
* @license AngularJS v1.2.32
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -296,9 +296,11 @@ angular.module('ngAnimate', ['ng'])
296296
//so that all the animated elements within the animation frame
297297
//will be properly updated and drawn on screen. This is
298298
//required to perform multi-class CSS based animations with
299-
//Firefox. DO NOT REMOVE THIS LINE.
300-
var a = bod.offsetWidth + 1;
301-
fn();
299+
//Firefox. DO NOT REMOVE THIS LINE. DO NOT OPTIMIZE THIS LINE.
300+
//THE MINIFIER WILL REMOVE IT OTHERWISE WHICH WILL RESULT IN AN
301+
//UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND WILL
302+
//TAKE YEARS AWAY FROM YOUR LIFE!
303+
fn(bod.offsetWidth);
302304
});
303305
};
304306
}])
@@ -1490,15 +1492,15 @@ angular.module('ngAnimate', ['ng'])
14901492
function onAnimationProgress(event) {
14911493
event.stopPropagation();
14921494
var ev = event.originalEvent || event;
1493-
var timeStamp = ev.$manualTimeStamp || ev.timeStamp || Date.now();
1495+
var timeStamp = ev.$manualTimeStamp || Date.now();
14941496

14951497
/* Firefox (or possibly just Gecko) likes to not round values up
14961498
* when a ms measurement is used for the animation */
14971499
var elapsedTime = parseFloat(ev.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES));
14981500

14991501
/* $manualTimeStamp is a mocked timeStamp value which is set
15001502
* within browserTrigger(). This is only here so that tests can
1501-
* mock animations properly. Real events fallback to event.timeStamp,
1503+
* mock animations properly. Real events fallback to Date.now(),
15021504
* or, if they don't, then a timeStamp is automatically created for them.
15031505
* We're checking to see if the timeStamp surpasses the expected delay,
15041506
* but we're using elapsedTime instead of the timeStamp on the 2nd

test/angular/1.2/angular-mocks.js

100755100644
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.2.28
2+
* @license AngularJS v1.2.32
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -1845,7 +1845,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
18451845
* @param {(Object|function(Object))=} headers HTTP headers or function that receives http header
18461846
* object and returns true if the headers match the current definition.
18471847
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
1848-
* control how a matched request is handled.
1848+
* controls how a matched request is handled.
18491849
*
18501850
* - respond –
18511851
* `{function([status,] data[, headers, statusText])
@@ -1868,7 +1868,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
18681868
* @param {string|RegExp} url HTTP url.
18691869
* @param {(Object|function(Object))=} headers HTTP headers.
18701870
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
1871-
* control how a matched request is handled.
1871+
* controls how a matched request is handled.
18721872
*/
18731873

18741874
/**
@@ -1881,7 +1881,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
18811881
* @param {string|RegExp} url HTTP url.
18821882
* @param {(Object|function(Object))=} headers HTTP headers.
18831883
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
1884-
* control how a matched request is handled.
1884+
* controls how a matched request is handled.
18851885
*/
18861886

18871887
/**
@@ -1894,7 +1894,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
18941894
* @param {string|RegExp} url HTTP url.
18951895
* @param {(Object|function(Object))=} headers HTTP headers.
18961896
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
1897-
* control how a matched request is handled.
1897+
* controls how a matched request is handled.
18981898
*/
18991899

19001900
/**
@@ -1908,7 +1908,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
19081908
* @param {(string|RegExp)=} data HTTP request body.
19091909
* @param {(Object|function(Object))=} headers HTTP headers.
19101910
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
1911-
* control how a matched request is handled.
1911+
* controls how a matched request is handled.
19121912
*/
19131913

19141914
/**
@@ -1922,7 +1922,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
19221922
* @param {(string|RegExp)=} data HTTP request body.
19231923
* @param {(Object|function(Object))=} headers HTTP headers.
19241924
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
1925-
* control how a matched request is handled.
1925+
* controls how a matched request is handled.
19261926
*/
19271927

19281928
/**
@@ -1936,7 +1936,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
19361936
* @param {(string|RegExp)=} data HTTP request body.
19371937
* @param {(Object|function(Object))=} headers HTTP headers.
19381938
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
1939-
* control how a matched request is handled.
1939+
* controls how a matched request is handled.
19401940
*/
19411941

19421942
/**
@@ -1948,7 +1948,7 @@ angular.module('ngMockE2E', ['ng']).config(['$provide', function($provide) {
19481948
*
19491949
* @param {string|RegExp} url HTTP url.
19501950
* @returns {requestHandler} Returns an object with `respond` and `passThrough` methods that
1951-
* control how a matched request is handled.
1951+
* controls how a matched request is handled.
19521952
*/
19531953
angular.mock.e2e = {};
19541954
angular.mock.e2e.$httpBackendDecorator =

test/angular/1.2/angular.js

100755100644
Lines changed: 87 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license AngularJS v1.2.28
2+
* @license AngularJS v1.2.32
33
* (c) 2010-2014 Google, Inc. http://angularjs.org
44
* License: MIT
55
*/
@@ -68,7 +68,7 @@ function minErr(module) {
6868
return match;
6969
});
7070

71-
message = message + '\nhttp://errors.angularjs.org/1.2.28/' +
71+
message = message + '\nhttp://errors.angularjs.org/1.2.32/' +
7272
(module ? module + '/' : '') + code;
7373
for (i = 2; i < arguments.length; i++) {
7474
message = message + (i == 2 ? '?' : '&') + 'p' + (i-2) + '=' +
@@ -482,6 +482,8 @@ noop.$inject = [];
482482
return (transformationFn || angular.identity)(value);
483483
};
484484
```
485+
* @param {*} value to be returned.
486+
* @returns {*} the value passed in.
485487
*/
486488
function identity($) {return $;}
487489
identity.$inject = [];
@@ -1987,11 +1989,11 @@ function setupModuleLoader(window) {
19871989
* - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
19881990
*/
19891991
var version = {
1990-
full: '1.2.28', // all of these placeholder strings will be replaced by grunt's
1992+
full: '1.2.32', // all of these placeholder strings will be replaced by grunt's
19911993
major: 1, // package task
19921994
minor: 2,
1993-
dot: 28,
1994-
codeName: 'finnish-disembarkation'
1995+
dot: 32,
1996+
codeName: 'alternation-intention'
19951997
};
19961998

19971999

@@ -4423,6 +4425,11 @@ function Browser(window, document, $log, $sniffer) {
44234425
}
44244426
}
44254427

4428+
function getHash(url) {
4429+
var index = url.indexOf('#');
4430+
return index === -1 ? '' : url.substr(index + 1);
4431+
}
4432+
44264433
/**
44274434
* @private
44284435
* Note: this method is used only by scenario runner
@@ -4534,8 +4541,10 @@ function Browser(window, document, $log, $sniffer) {
45344541
}
45354542
if (replace) {
45364543
___location.replace(url);
4537-
} else {
4544+
} else if (!sameBase) {
45384545
___location.href = url;
4546+
} else {
4547+
___location.hash = getHash(url);
45394548
}
45404549
}
45414550
return self;
@@ -5923,10 +5932,11 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
59235932
}
59245933
}
59255934

5926-
nodeName = nodeName_(this.$$element);
5935+
// SVG elements' `nodeName` can be lowercase
5936+
nodeName = nodeName_(this.$$element).toUpperCase();
59275937

59285938
// sanitize a[href] and img[src] values
5929-
if ((nodeName === 'A' && key === 'href') ||
5939+
if ((nodeName === 'A' && (key === 'href' || key === 'xlinkHref')) ||
59305940
(nodeName === 'IMG' && key === 'src')) {
59315941
this[key] = value = $$sanitizeUri(value, key === 'src');
59325942
}
@@ -6187,13 +6197,17 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
61876197
var nodeType = node.nodeType,
61886198
attrsMap = attrs.$attr,
61896199
match,
6200+
nodeName,
61906201
className;
61916202

61926203
switch(nodeType) {
61936204
case 1: /* Element */
6205+
6206+
nodeName = nodeName_(node).toLowerCase();
6207+
61946208
// use the node name: <directive>
61956209
addDirective(directives,
6196-
directiveNormalize(nodeName_(node).toLowerCase()), 'E', maxPriority, ignoreDirective);
6210+
directiveNormalize(nodeName), 'E', maxPriority, ignoreDirective);
61976211

61986212
// iterate over the attributes
61996213
for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,
@@ -6233,6 +6247,12 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
62336247
}
62346248
}
62356249

6250+
if (nodeName === 'input' && node.getAttribute('type') === 'hidden') {
6251+
// Hidden input elements can have strange behaviour when navigating back to the page
6252+
// This tells the browser not to try to cache and reinstate previous values
6253+
node.setAttribute('autocomplete', 'off');
6254+
}
6255+
62366256
// use class as directive
62376257
className = node.className;
62386258
if (isString(className) && className !== '') {
@@ -6246,6 +6266,13 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
62466266
}
62476267
break;
62486268
case 3: /* Text Node */
6269+
if (msie === 11) {
6270+
// Workaround for #11781
6271+
while (node.parentNode && node.nextSibling && node.nextSibling.nodeType === 3 /* Text Node */) {
6272+
node.nodeValue = node.nodeValue + node.nextSibling.nodeValue;
6273+
node.parentNode.removeChild(node.nextSibling);
6274+
}
6275+
}
62496276
addTextInterpolateDirective(directives, node.nodeValue);
62506277
break;
62516278
case 8: /* Comment */
@@ -7031,6 +7058,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
70317058
// maction[xlink:href] can source SVG. It's not limited to <maction>.
70327059
if (attrNormalizedName == "xlinkHref" ||
70337060
(tag == "FORM" && attrNormalizedName == "action") ||
7061+
// links can be stylesheets or imports, which can run script in the current origin
7062+
(tag == "LINK" && attrNormalizedName == "href") ||
70347063
(tag != "IMG" && (attrNormalizedName == "src" ||
70357064
attrNormalizedName == "ngSrc"))) {
70367065
return $sce.RESOURCE_URL;
@@ -9290,6 +9319,10 @@ function stripHash(url) {
92909319
return index == -1 ? url : url.substr(0, index);
92919320
}
92929321

9322+
function trimEmptyHash(url) {
9323+
return url.replace(/(#.+)|#$/, '$1');
9324+
}
9325+
92939326

92949327
function stripFile(url) {
92959328
return url.substr(0, stripHash(url).lastIndexOf('/') + 1);
@@ -9946,10 +9979,11 @@ function $LocationProvider(){
99469979
// update browser
99479980
var changeCounter = 0;
99489981
$rootScope.$watch(function $locationWatch() {
9949-
var oldUrl = $browser.url();
9982+
var oldUrl = trimEmptyHash($browser.url());
9983+
var newUrl = trimEmptyHash($___location.absUrl());
99509984
var currentReplace = $___location.$$replace;
99519985

9952-
if (!changeCounter || oldUrl != $___location.absUrl()) {
9986+
if (!changeCounter || oldUrl != newUrl) {
99539987
changeCounter++;
99549988
$rootScope.$evalAsync(function() {
99559989
if ($rootScope.$broadcast('$locationChangeStart', $___location.absUrl(), oldUrl).
@@ -10170,7 +10204,26 @@ function ensureSafeMemberName(name, fullExpression) {
1017010204
|| name === "__proto__") {
1017110205
throw $parseMinErr('isecfld',
1017210206
'Attempting to access a disallowed field in Angular expressions! '
10173-
+'Expression: {0}', fullExpression);
10207+
+ 'Expression: {0}', fullExpression);
10208+
}
10209+
return name;
10210+
}
10211+
10212+
function getStringValue(name, fullExpression) {
10213+
// From the JavaScript docs:
10214+
// Property names must be strings. This means that non-string objects cannot be used
10215+
// as keys in an object. Any non-string object, including a number, is typecasted
10216+
// into a string via the toString method.
10217+
//
10218+
// So, to ensure that we are checking the same `name` that JavaScript would use,
10219+
// we cast it to a string, if possible.
10220+
// Doing `name + ''` can cause a repl error if the result to `toString` is not a string,
10221+
// this is, this will handle objects that misbehave.
10222+
name = name + '';
10223+
if (!isString(name)) {
10224+
throw $parseMinErr('iseccst',
10225+
'Cannot convert object to primitive value! '
10226+
+ 'Expression: {0}', fullExpression);
1017410227
}
1017510228
return name;
1017610229
}
@@ -10849,7 +10902,7 @@ Parser.prototype = {
1084910902

1085010903
return extend(function(self, locals) {
1085110904
var o = obj(self, locals),
10852-
i = indexFn(self, locals),
10905+
i = getStringValue(indexFn(self, locals), parser.text),
1085310906
v, p;
1085410907

1085510908
ensureSafeMemberName(i, parser.text);
@@ -10866,7 +10919,7 @@ Parser.prototype = {
1086610919
return v;
1086710920
}, {
1086810921
assign: function(self, value, locals) {
10869-
var key = ensureSafeMemberName(indexFn(self, locals), parser.text);
10922+
var key = ensureSafeMemberName(getStringValue(indexFn(self, locals), parser.text), parser.text);
1087010923
// prevent overwriting of Function.constructor which would break ensureSafeObject check
1087110924
var o = ensureSafeObject(obj(self, locals), parser.text);
1087210925
if (!o) obj.assign(self, o = {});
@@ -13153,6 +13206,21 @@ function $RootScopeProvider(){
1315313206
}];
1315413207
}
1315513208

13209+
/**
13210+
* @ngdoc service
13211+
* @name $rootElement
13212+
*
13213+
* @description
13214+
* The root element of Angular application. This is either the element where {@link
13215+
* ng.directive:ngApp ngApp} was declared or the element passed into
13216+
* {@link angular.bootstrap}. The element represent the root element of application. It is also the
13217+
* ___location where the applications {@link auto.$injector $injector} service gets
13218+
* published, it can be retrieved using `$rootElement.injector()`.
13219+
*/
13220+
13221+
13222+
// the implementation is in angular.bootstrap
13223+
1315613224
/**
1315713225
* @description
1315813226
* Private service to sanitize uris for links and images. Used by $compile and $sanitize.
@@ -15548,37 +15616,12 @@ function limitToFilter(){
1554815616
limit = int(limit);
1554915617
}
1555015618

15551-
if (isString(input)) {
15552-
//NaN check on limit
15553-
if (limit) {
15554-
return limit >= 0 ? input.slice(0, limit) : input.slice(limit, input.length);
15555-
} else {
15556-
return "";
15557-
}
15558-
}
15559-
15560-
var out = [],
15561-
i, n;
15562-
15563-
// if abs(limit) exceeds maximum length, trim it
15564-
if (limit > input.length)
15565-
limit = input.length;
15566-
else if (limit < -input.length)
15567-
limit = -input.length;
15568-
15569-
if (limit > 0) {
15570-
i = 0;
15571-
n = limit;
15619+
//NaN check on limit
15620+
if (limit) {
15621+
return limit > 0 ? input.slice(0, limit) : input.slice(limit);
1557215622
} else {
15573-
i = input.length + limit;
15574-
n = input.length;
15575-
}
15576-
15577-
for (; i<n; i++) {
15578-
out.push(input[i]);
15623+
return isString(input) ? "" : [];
1557915624
}
15580-
15581-
return out;
1558215625
};
1558315626
}
1558415627

@@ -19851,7 +19894,7 @@ var ngIfDirective = ['$animate', function($animate) {
1985119894
<select ng-model="template" ng-options="t.name for t in templates">
1985219895
<option value="">(blank)</option>
1985319896
</select>
19854-
url of the template: <tt>{{template.url}}</tt>
19897+
url of the template: <code>{{template.url}}</code>
1985519898
<hr/>
1985619899
<div class="slide-animate-container">
1985719900
<div class="slide-animate" ng-include="template.url"></div>

0 commit comments

Comments
 (0)