[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

@@ -36,7 +36,7 @@ define([
treeView;
function makeMockDomainObject(id, model, capabilities) {
var mockDomainObject = jasmine.createSpyObj(
var mockDomainObj = jasmine.createSpyObj(
'domainObject-' + id,
[
'getId',
@@ -46,18 +46,18 @@ define([
'useCapability'
]
);
mockDomainObject.getId.andReturn(id);
mockDomainObject.getModel.andReturn(model);
mockDomainObject.hasCapability.andCallFake(function (c) {
mockDomainObj.getId.andReturn(id);
mockDomainObj.getModel.andReturn(model);
mockDomainObj.hasCapability.andCallFake(function (c) {
return !!(capabilities[c]);
});
mockDomainObject.getCapability.andCallFake(function (c) {
mockDomainObj.getCapability.andCallFake(function (c) {
return capabilities[c];
});
mockDomainObject.useCapability.andCallFake(function (c) {
mockDomainObj.useCapability.andCallFake(function (c) {
return capabilities[c] && capabilities[c].invoke();
});
return mockDomainObject;
return mockDomainObj;
}
beforeEach(function () {
@@ -99,24 +99,16 @@ define([
var mockComposition;
function makeGenericCapabilities() {
var mockContext =
jasmine.createSpyObj('context', ['getPath']),
mockType =
jasmine.createSpyObj('type', ['getGlyph']),
mockLocation =
jasmine.createSpyObj('location', ['isLink']),
mockMutation =
jasmine.createSpyObj('mutation', ['listen']),
mockStatus =
var mockStatus =
jasmine.createSpyObj('status', ['listen', 'list']);
mockStatus.list.andReturn([]);
return {
context: mockContext,
type: mockType,
mutation: mockMutation,
location: mockLocation,
context: jasmine.createSpyObj('context', ['getPath']),
type: jasmine.createSpyObj('type', ['getGlyph']),
location: jasmine.createSpyObj('location', ['isLink']),
mutation: jasmine.createSpyObj('mutation', ['listen']),
status: mockStatus
};
}
@@ -133,11 +125,11 @@ define([
beforeEach(function () {
mockComposition = ['a', 'b', 'c'].map(function (id) {
var testCapabilities = makeGenericCapabilities(),
var testCaps = makeGenericCapabilities(),
mockChild =
makeMockDomainObject(id, {}, testCapabilities);
makeMockDomainObject(id, {}, testCaps);
testCapabilities.context.getPath
testCaps.context.getPath
.andReturn([mockDomainObject, mockChild]);
return mockChild;
@@ -207,11 +199,11 @@ define([
describe("when a context-less object is selected", function () {
beforeEach(function () {
var testCapabilities = makeGenericCapabilities(),
mockDomainObject =
makeMockDomainObject('xyz', {}, testCapabilities);
delete testCapabilities.context;
treeView.value(mockDomainObject);
var testCaps = makeGenericCapabilities(),
mockDomainObj =
makeMockDomainObject('xyz', {}, testCaps);
delete testCaps.context;
treeView.value(mockDomainObj);
});
it("clears all selection state", function () {