[Code Style] Rename shadowing variables

This commit is contained in:
Victor Woeltjen
2016-05-20 11:39:49 -07:00
parent e468080373
commit ad5691142e
56 changed files with 256 additions and 262 deletions

View File

@ -82,7 +82,7 @@ define(
return mutationResult && self.invoke().then(findObject);
}
function addIdToModel(model) {
function addIdToModel(objModel) {
// Pick a specific index if needed.
index = isNaN(index) ? composition.length : index;
// Also, don't put past the end of the array
@ -90,11 +90,11 @@ define(
// Remove the existing instance of the id
if (oldIndex !== -1) {
model.composition.splice(oldIndex, 1);
objModel.composition.splice(oldIndex, 1);
}
// ...and add it back at the appropriate index.
model.composition.splice(index, 0, id);
objModel.composition.splice(index, 0, id);
}
// If no index has been specified already and the id is already

View File

@ -62,9 +62,9 @@ define(
}
// Package capabilities as key-value pairs
function packageCapabilities(capabilities) {
function packageCapabilities(caps) {
var result = {};
capabilities.forEach(function (capability) {
caps.forEach(function (capability) {
if (capability.key) {
result[capability.key] =
result[capability.key] || capability;

View File

@ -124,9 +124,9 @@ define(
clone = JSON.parse(JSON.stringify(model)),
useTimestamp = arguments.length > 1;
function notifyListeners(model) {
function notifyListeners(newModel) {
generalTopic.notify(domainObject);
specificTopic.notify(model);
specificTopic.notify(newModel);
}
// Function to handle copying values to the actual

View File

@ -124,8 +124,8 @@ define(
this.persistenceService.createObject;
// Update persistence timestamp...
domainObject.useCapability("mutation", function (model) {
model.persisted = modified;
domainObject.useCapability("mutation", function (m) {
m.persisted = modified;
}, modified);
// ...and persist