mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-16 23:30:23 +00:00
fixing lint warnings
This commit is contained in:
parent
9312bed472
commit
885c3ad5dd
7 changed files with 15 additions and 14 deletions
|
|
@ -1027,8 +1027,8 @@ function assertArg(arg, name, reason) {
|
|||
if (window.console) window.console.log(error.stack);
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function assertArgFn(arg, name) {
|
||||
assertArg(isFunction(arg, name, 'not a function'));
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ function createInjector(providerScope, providers, cache) {
|
|||
}
|
||||
|
||||
function injectService(services, fn) {
|
||||
return extend(fn, {$inject:services});;
|
||||
return extend(fn, {$inject:services});
|
||||
}
|
||||
|
||||
function injectUpdateView(fn) {
|
||||
|
|
@ -113,4 +113,4 @@ function injectionArgs(fn) {
|
|||
});
|
||||
}
|
||||
return fn.$inject;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -251,11 +251,13 @@ forEach({
|
|||
* Properties: writes return selection, reads return first value
|
||||
*/
|
||||
JQLite.prototype[name] = function(arg1, arg2) {
|
||||
var i, key;
|
||||
|
||||
if ((fn.length == 2 ? arg1 : arg2) === undefined) {
|
||||
if (isObject(arg1)) {
|
||||
// we are a write, but the object properties are the key/values
|
||||
for(var i=0; i < this.length; i++) {
|
||||
for ( var key in arg1) {
|
||||
for(i=0; i < this.length; i++) {
|
||||
for (key in arg1) {
|
||||
fn(this[i], key, arg1[key]);
|
||||
}
|
||||
}
|
||||
|
|
@ -268,7 +270,7 @@ forEach({
|
|||
}
|
||||
} else {
|
||||
// we are a write, so apply to all children
|
||||
for(var i=0; i < this.length; i++) {
|
||||
for(i=0; i < this.length; i++) {
|
||||
fn(this[i], arg1, arg2);
|
||||
}
|
||||
// return self for chaining
|
||||
|
|
|
|||
|
|
@ -362,7 +362,6 @@ function parser(text, json){
|
|||
var token = expect();
|
||||
var formatter = angularFormatter[token.text];
|
||||
var argFns = [];
|
||||
var token;
|
||||
if (!formatter) throwError('is not a valid formatter.', token);
|
||||
while(true) {
|
||||
if ((token = expect(':'))) {
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ describe('injector', function(){
|
|||
|
||||
describe('annotation', function(){
|
||||
it('should return $inject', function(){
|
||||
function fn(){};
|
||||
function fn(){}
|
||||
fn.$inject = ['a'];
|
||||
expect(injectionArgs(fn)).toBe(fn.$inject);
|
||||
expect(injectionArgs(function(){})).toEqual([]);
|
||||
|
|
@ -105,19 +105,19 @@ describe('injector', function(){
|
|||
multi-line comment
|
||||
function (a, b){}
|
||||
*/
|
||||
/* {some type} */ c){ extraParans();};
|
||||
/* {some type} */ c){ extraParans();}
|
||||
expect(injectionArgs($f_n0)).toEqual(['$a', 'b']);
|
||||
expect($f_n0.$inject).toEqual(['$a', 'b']);
|
||||
});
|
||||
|
||||
it('should handle no arg functions', function(){
|
||||
function $f_n0(){};
|
||||
function $f_n0(){}
|
||||
expect(injectionArgs($f_n0)).toEqual([]);
|
||||
expect($f_n0.$inject).toEqual([]);
|
||||
});
|
||||
|
||||
it('should handle args with both $ and _', function(){
|
||||
function $f_n0($a_){};
|
||||
function $f_n0($a_){}
|
||||
expect(injectionArgs($f_n0)).toEqual(['$a']);
|
||||
expect($f_n0.$inject).toEqual(['$a']);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ describe('HTML', function(){
|
|||
function tag(name) {
|
||||
writer.start(name, {});
|
||||
writer.end(name);
|
||||
};
|
||||
}
|
||||
tag('frameset');
|
||||
tag('frame');
|
||||
tag('form');
|
||||
|
|
|
|||
|
|
@ -798,7 +798,7 @@ describe("widget", function(){
|
|||
|
||||
|
||||
describe('ng:view', function() {
|
||||
var rootScope, rootScope, $route, $location, $browser;
|
||||
var rootScope, $route, $location, $browser;
|
||||
|
||||
beforeEach(function() {
|
||||
rootScope = angular.compile('<ng:view></ng:view>')();
|
||||
|
|
|
|||
Loading…
Reference in a new issue