Skip to content

Commit f84447f

Browse files
Merge pull request #5 from angular/master
Update upstream
2 parents 3ec4506 + bf5c2ee commit f84447f

File tree

7 files changed

+49
-58
lines changed

7 files changed

+49
-58
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "angularjs",
33
"license": "MIT",
44
"devDependencies": {
5-
"jquery": "3.1.0",
5+
"jquery": "3.2.1",
66
"jquery-2.2": "jquery#2.2.4",
77
"jquery-2.1": "jquery#2.1.4",
88
"closure-compiler": "https://dl.google.com/closure-compiler/compiler-20140814.zip",

docs/content/tutorial/step_14.ngdoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ Since we are using [Bower][bower] to install client-side dependencies, this step
4646
"angular-resource": "1.5.x",
4747
"angular-route": "1.5.x",
4848
"bootstrap": "3.3.x",
49-
"jquery": "2.2.x"
49+
"jquery": "3.2.x"
5050
}
5151
}
5252
```
5353

5454
* `"angular-animate": "1.5.x"` tells bower to install a version of the angular-animate module that
5555
is compatible with version 1.5.x of AngularJS.
56-
* `"jquery": "2.2.x"` tells bower to install the latest patch release of the 2.2 version of jQuery.
56+
* `"jquery": "3.2.x"` tells bower to install the latest patch release of the 3.2 version of jQuery.
5757
Note that this is not an AngularJS library; it is the standard jQuery library. We can use bower to
5858
install a wide range of 3rd party libraries.
5959

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"jasmine-core": "^2.4.0",
6060
"jasmine-node": "^2.0.0",
6161
"jasmine-reporters": "^2.2.0",
62-
"jquery": "^3.1.1",
62+
"jquery": "^3.2.1",
6363
"karma": "^1.1.2",
6464
"karma-browserstack-launcher": "^1.0.1",
6565
"karma-chrome-launcher": "^1.0.1",

src/jqLite.js

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -201,12 +201,6 @@ function jqLiteHasData(node) {
201201
return false;
202202
}
203203

204-
function jqLiteCleanData(nodes) {
205-
for (var i = 0, ii = nodes.length; i < ii; i++) {
206-
jqLiteRemoveData(nodes[i]);
207-
}
208-
}
209-
210204
function jqLiteBuildFragment(html, context) {
211205
var tmp, tag, wrap,
212206
fragment = context.createDocumentFragment(),
@@ -309,13 +303,10 @@ function jqLiteClone(element) {
309303
}
310304

311305
function jqLiteDealoc(element, onlyDescendants) {
312-
if (!onlyDescendants) jqLiteRemoveData(element);
306+
if (!onlyDescendants && jqLiteAcceptsData(element)) jqLite.cleanData([element]);
313307

314308
if (element.querySelectorAll) {
315-
var descendants = element.querySelectorAll('*');
316-
for (var i = 0, l = descendants.length; i < l; i++) {
317-
jqLiteRemoveData(descendants[i]);
318-
}
309+
jqLite.cleanData(element.querySelectorAll('*'));
319310
}
320311
}
321312

@@ -613,7 +604,11 @@ forEach({
613604
data: jqLiteData,
614605
removeData: jqLiteRemoveData,
615606
hasData: jqLiteHasData,
616-
cleanData: jqLiteCleanData
607+
cleanData: function jqLiteCleanData(nodes) {
608+
for (var i = 0, ii = nodes.length; i < ii; i++) {
609+
jqLiteRemoveData(nodes[i]);
610+
}
611+
}
617612
}, function(fn, name) {
618613
JQLite[name] = fn;
619614
});

src/ng/interval.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function $IntervalProvider() {
4141
* @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
4242
* will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
4343
* @param {...*=} Pass additional parameters to the executed function.
44-
* @returns {promise} A promise which will be notified on each iteration.
44+
* @returns {promise} A promise which will be notified on each iteration. It will resolve once all iterations of the interval complete.
4545
*
4646
* @example
4747
* <example module="intervalExample" name="interval-service">

test/ng/compileSpec.js

Lines changed: 34 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,28 +2100,26 @@ describe('$compile', function() {
21002100

21012101
it('should work in jqLite and jQuery with jQuery.cleanData last patched by Angular', runTest);
21022102

2103-
if (jQuery) {
2104-
it('should work with another library patching jQuery.cleanData after Angular', function() {
2105-
var cleanedCount = 0;
2106-
var currentCleanData = jqLite.cleanData;
2107-
jqLite.cleanData = function(elems) {
2108-
cleanedCount += elems.length;
2109-
// Don't return the output and explicitly pass only the first parameter
2110-
// so that we're sure we're not relying on either of them. jQuery UI patch
2111-
// behaves in this way.
2112-
currentCleanData(elems);
2113-
};
2103+
it('should work with another library patching jqLite/jQuery.cleanData after Angular', function() {
2104+
var cleanedCount = 0;
2105+
var currentCleanData = jqLite.cleanData;
2106+
jqLite.cleanData = function(elems) {
2107+
cleanedCount += elems.length;
2108+
// Don't return the output and explicitly pass only the first parameter
2109+
// so that we're sure we're not relying on either of them. jQuery UI patch
2110+
// behaves in this way.
2111+
currentCleanData(elems);
2112+
};
21142113

2115-
runTest();
2114+
runTest();
21162115

2117-
// The initial ng-repeat div is dumped after parsing hence we expect cleanData
2118-
// count to be one larger than size of the iterated array.
2119-
expect(cleanedCount).toBe(is.length + 1);
2116+
// The initial ng-repeat div is dumped after parsing hence we expect cleanData
2117+
// count to be one larger than size of the iterated array.
2118+
expect(cleanedCount).toBe(is.length + 1);
21202119

2121-
// Restore the previous cleanData.
2122-
jqLite.cleanData = currentCleanData;
2123-
});
2124-
}
2120+
// Restore the previous cleanData.
2121+
jqLite.cleanData = currentCleanData;
2122+
});
21252123
});
21262124

21272125
describe('replace and not exactly one root element', function() {
@@ -8640,28 +8638,26 @@ describe('$compile', function() {
86408638

86418639
it('should work without external libraries (except jQuery)', testCleanup);
86428640

8643-
if (jQuery) {
8644-
it('should work with another library patching jQuery.cleanData after AngularJS', function() {
8645-
var cleanedCount = 0;
8646-
var currentCleanData = jqLite.cleanData;
8647-
jqLite.cleanData = function(elems) {
8648-
cleanedCount += elems.length;
8649-
// Don't return the output and explicitly pass only the first parameter
8650-
// so that we're sure we're not relying on either of them. jQuery UI patch
8651-
// behaves in this way.
8652-
currentCleanData(elems);
8653-
};
8641+
it('should work with another library patching jqLite/jQuery.cleanData after AngularJS', function() {
8642+
var cleanedCount = 0;
8643+
var currentCleanData = jqLite.cleanData;
8644+
jqLite.cleanData = function(elems) {
8645+
cleanedCount += elems.length;
8646+
// Don't return the output and explicitly pass only the first parameter
8647+
// so that we're sure we're not relying on either of them. jQuery UI patch
8648+
// behaves in this way.
8649+
currentCleanData(elems);
8650+
};
86548651

8655-
testCleanup();
8652+
testCleanup();
86568653

8657-
// The ng-repeat template is removed/cleaned (the +1)
8658-
// and each clone of the ng-repeat template is also removed (xs.length)
8659-
expect(cleanedCount).toBe(xs.length + 1);
8654+
// The ng-repeat template is removed/cleaned (the +1)
8655+
// and each clone of the ng-repeat template is also removed (xs.length)
8656+
expect(cleanedCount).toBe(xs.length + 1);
86608657

8661-
// Restore the previous cleanData.
8662-
jqLite.cleanData = currentCleanData;
8663-
});
8664-
}
8658+
// Restore the previous cleanData.
8659+
jqLite.cleanData = currentCleanData;
8660+
});
86658661
});
86668662

86678663

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3508,9 +3508,9 @@ jodid25519@^1.0.0:
35083508
dependencies:
35093509
jsbn "~0.1.0"
35103510

3511-
jquery@^3.1.1:
3512-
version "3.1.1"
3513-
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.1.1.tgz#347c1c21c7e004115e0a4da32cece041fad3c8a3"
3511+
jquery@^3.2.1:
3512+
version "3.2.1"
3513+
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.2.1.tgz#5c4d9de652af6cd0a770154a631bba12b015c787"
35143514

35153515
js-tokens@^3.0.0:
35163516
version "3.0.1"

0 commit comments

Comments
 (0)