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

style(*): remove unused variables #13701

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ function copy(source, destination) {

function copyRecurse(source, destination) {
var h = destination.$$hashKey;
var result, key;
var key;
if (isArray(source)) {
for (var i = 0, ii = source.length; i < ii; i++) {
destination.push(copyElement(source[i]));
Expand Down
1 change: 0 additions & 1 deletion src/ng/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
*/
function Browser(window, document, $log, $sniffer) {
var self = this,
rawDocument = document[0],
location = window.location,
history = window.history,
setTimeout = window.setTimeout,
Expand Down
2 changes: 1 addition & 1 deletion src/ng/directive/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
if (!$sniffer.android) {
var composing = false;

element.on('compositionstart', function(data) {
element.on('compositionstart', function() {
composing = true;
});

Expand Down
8 changes: 4 additions & 4 deletions src/ng/directive/ngModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
};
ngModelSet = function($scope, newValue) {
if (isFunction(parsedNgModel($scope))) {
invokeModelSetter($scope, {$$$p: ctrl.$modelValue});
invokeModelSetter($scope, {$$$p: newValue});
} else {
parsedNgModelAssign($scope, ctrl.$modelValue);
parsedNgModelAssign($scope, newValue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lgalfaso are these two changes correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
};
} else if (!parsedNgModel.assign) {
Expand Down Expand Up @@ -644,7 +644,7 @@ var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$
setValidity(name, undefined);
validatorPromises.push(promise.then(function() {
setValidity(name, true);
}, function(error) {
}, function() {
allValid = false;
setValidity(name, false);
}));
Expand Down Expand Up @@ -1102,7 +1102,7 @@ var ngModelDirective = ['$rootScope', function($rootScope) {
});
}

element.on('blur', function(ev) {
element.on('blur', function() {
if (modelCtrl.$touched) return;

if ($rootScope.$$phase) {
Expand Down
4 changes: 2 additions & 2 deletions src/ng/directive/ngOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,8 @@ var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {
var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];
var value = optionValues[key];

var locals = getLocals(optionValues[key], key);
var selectValue = getTrackByValueFn(optionValues[key], locals);
var locals = getLocals(value, key);
var selectValue = getTrackByValueFn(value, locals);
watchedArray.push(selectValue);

// Only need to watch the displayFn if there is a specific label expression
Expand Down
2 changes: 1 addition & 1 deletion src/ng/directive/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function chromeHack(optionElement) {
* added `<option>` elements, perhaps by an `ngRepeat` directive.
*/
var SelectController =
['$element', '$scope', '$attrs', function($element, $scope, $attrs) {
['$element', '$scope', function($element, $scope) {

var self = this,
optionsMap = new HashMap();
Expand Down
2 changes: 1 addition & 1 deletion src/ng/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function $HttpParamSerializerProvider() {
forEachSorted(params, function(value, key) {
if (value === null || isUndefined(value)) return;
if (isArray(value)) {
forEach(value, function(v, k) {
forEach(value, function(v) {
parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(v)));
});
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/ng/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ ASTInterpreter.prototype = {
return context ? {value: locals} : locals;
};
case AST.NGValueParameter:
return function(scope, locals, assign, inputs) {
return function(scope, locals, assign) {
return context ? {value: assign} : assign;
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/ng/rootScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ function $RootScopeProvider() {
dirty, ttl = TTL,
next, current, target = this,
watchLog = [],
logIdx, logMsg, asyncTask;
logIdx, asyncTask;

beginPhase('$digest');
// Check for changes to browser url that happened in sync before the call to $digest
Expand Down
4 changes: 2 additions & 2 deletions src/ng/templateRequest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

var $compileMinErr = minErr('$compile');
var $templateRequestMinErr = minErr('$compile');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also just reuse the already created $compileMinErr.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured this file shouldn't depend on compile.js like that. Might want to also remove the '$compile' string but I figured that would be another change...


/**
* @ngdoc provider
Expand Down Expand Up @@ -96,7 +96,7 @@ function $TemplateRequestProvider() {

function handleError(resp) {
if (!ignoreRequestError) {
throw $compileMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})',
throw $templateRequestMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})',
tpl, resp.status, resp.statusText);
}
return $q.reject(resp);
Expand Down