Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit e27461f

Browse files
committed
[WIP] code review
1 parent 3f0bc0e commit e27461f

File tree

10 files changed

+17
-24
lines changed

10 files changed

+17
-24
lines changed

Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ module.exports = function(grunt) {
126126
'src/**/*.js',
127127
'test/**/*.js',
128128
'i18n/**/*.js',
129-
'!docs/app/assets/**',
129+
'!docs/app/assets/js/angular-bootstrap/**',
130130
'!docs/bower_components/**',
131131
'!docs/config/templates/**',
132132
'!src/angular.bind.js',

benchmarks/largetable-bp/app.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ app.controller('DataController', function DataController($scope, $rootScope) {
2323
$scope.numberOfBindings = totalRows * totalColumns * 2 + totalRows + 1;
2424
$scope.numberOfWatches = '?';
2525

26-
/* @this DataController */
26+
/* @this */
2727
function iGetter() { return this.i; }
28-
/* @this DataController */
28+
/* @this */
2929
function jGetter() { return this.j; }
3030

3131
for (var i = 0; i < totalRows; i++) {

src/ngResource/resource.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ function shallowClearAndCopy(src, dst) {
425425
*
426426
*/
427427
angular.module('ngResource', ['ng']).
428-
provider('$resource', function Resource() {
428+
provider('$resource', function ResourceProvider() {
429429
var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\/\/[^\/]*/;
430430

431431
var provider = this;

test/AngularSpec.js

+5-8
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
// Lots of typed array globals are used in this file and ESLint is
44
// not smart enough to understand the `typeof !== 'undefined'` guards.
5-
/* eslint-env es6 */
6-
/* globals Blob */
5+
/* globals Blob, Uint8ClampedArray, Uint16Array, Uint32Array, Int8Array, Int16Array, Int32Array,
6+
Float32Array, Float64Array, */
77

88
describe('angular', function() {
99
var element, document;
@@ -568,29 +568,26 @@ describe('angular', function() {
568568
});
569569

570570
it('should copy String() objects', function() {
571-
/* eslint-disable no-new-wrappers */
571+
// eslint-disable-next-line no-new-wrappers
572572
var obj = new String('foo');
573-
/* eslint-enable */
574573
var dest = copy(obj);
575574
expect(dest).not.toBe(obj);
576575
expect(isObject(dest)).toBe(true);
577576
expect(dest.valueOf()).toBe(obj.valueOf());
578577
});
579578

580579
it('should copy Boolean() objects', function() {
581-
/* eslint-disable no-new-wrappers */
580+
// eslint-disable-next-line no-new-wrappers
582581
var obj = new Boolean(true);
583-
/* eslint-enable */
584582
var dest = copy(obj);
585583
expect(dest).not.toBe(obj);
586584
expect(isObject(dest)).toBe(true);
587585
expect(dest.valueOf()).toBe(obj.valueOf());
588586
});
589587

590588
it('should copy Number() objects', function() {
591-
/* eslint-disable no-new-wrappers */
589+
// eslint-disable-next-line no-new-wrappers
592590
var obj = new Number(42);
593-
/* eslint-enable */
594591
var dest = copy(obj);
595592
expect(dest).not.toBe(obj);
596593
expect(isObject(dest)).toBe(true);

test/e2e/tools/.eslintrc.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
{
22
"root": true,
3-
"extends": "../../../.eslintrc-node.json",
4-
5-
"env": {
6-
"jasmine": false
7-
}
3+
"extends": "../../../.eslintrc-node.json"
84
}

test/helpers/privateMocks.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function xthey(msg, vals, spec) {
3131
}
3232

3333
function browserSupportsCssAnimations() {
34-
// Support: IE < 11
34+
// Support: IE < 10
3535
// Only IE10+ support keyframes / transitions
3636
return !(window.document.documentMode < 10);
3737
}

test/helpers/testabilityPatch.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ function sortedHtml(element, showNgClass) {
230230
}
231231
for (var css in node.style) {
232232
var value = node.style[css];
233-
if (isString(value) && isString(css) && css !== 'cssText' && value && (1 * css !== css)) {
233+
if (isString(value) && isString(css) && css !== 'cssText' && value && isNaN(Number(css))) {
234234
var text = lowercase(css + ': ' + value);
235235
if (value !== 'false' && style.indexOf(text) === -1) {
236236
style.push(text);

test/ng/directive/ngRepeatSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ describe('ngRepeat', function() {
11431143
scope.$digest();
11441144
expect($exceptionHandler.errors.shift().message).
11451145
toMatch(
1146-
/^\[ngRepeat:dupes] Duplicates in a repeater are not allowed\. Use 'track by' expression to specify unique keys\. Repeater: item in items, Duplicate key: object:3, Duplicate value: /);
1146+
/^\[ngRepeat:dupes] Duplicates in a repeater are not allowed\. Use 'track by' expression to specify unique keys\. Repeater: item in items, Duplicate key: object:3, Duplicate value: {}/);
11471147

11481148
// recover
11491149
scope.items = [a];
@@ -1164,7 +1164,7 @@ describe('ngRepeat', function() {
11641164
scope.$digest();
11651165
expect($exceptionHandler.errors.shift().message).
11661166
toMatch(
1167-
/^\[ngRepeat:dupes] Duplicates in a repeater are not allowed\. Use 'track by' expression to specify unique keys\. Repeater: item in items, Duplicate key: object:9, Duplicate value: /);
1167+
/^\[ngRepeat:dupes] Duplicates in a repeater are not allowed\. Use 'track by' expression to specify unique keys\. Repeater: item in items, Duplicate key: object:9, Duplicate value: {}/);
11681168

11691169
// recover
11701170
scope.items = [a];

test/ng/parseSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -2946,15 +2946,15 @@ describe('parser', function() {
29462946
});
29472947
});
29482948

2949-
it('should prevent the exploit', function() {
2949+
it('should prevent the exploit', function() {
29502950
expect(function() {
29512951
scope.$eval('(1)[{0: "__proto__", 1: "__proto__", 2: "__proto__", 3: "safe", length: 4, toString: [].pop}].foo = 1');
29522952
}).toThrow();
29532953
if (!msie || msie > 10) {
29542954
// eslint-disable-next-line no-proto
29552955
expect((1)['__proto__'].foo).toBeUndefined();
29562956
}
2957-
});
2957+
});
29582958

29592959
it('should prevent the exploit', function() {
29602960
expect(function() {

test/ngMock/angular-mocksSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -948,7 +948,7 @@ describe('ngMock', function() {
948948
if (!error.stack) {
949949
try {
950950
throw error;
951-
} catch (e) { /** do nothing **/}
951+
} catch (e) { /* empty */}
952952
}
953953

954954
return !!error.stack;

0 commit comments

Comments
 (0)