Skip to content

Commit

Permalink
Merge pull request #5372 from AnalyticalGraphicsInc/fix-eslint
Browse files Browse the repository at this point in the history
Fix eslint in 3D-tiles branch
  • Loading branch information
mramato authored May 26, 2017
2 parents afbb41c + 872c837 commit e0599a2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Heap.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ define([
var data = this._data;
var candidate = -1;

while (true) {
while (true) { // eslint-disable-line no-constant-condition
var right = 2 * (index + 1);
var left = right - 1;

Expand Down
2 changes: 1 addition & 1 deletion Source/Scene/Cesium3DTileBatchTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ define([
}

function traverseHierarchySingleParent(hierarchy, instanceIndex, endConditionCallback) {
while (true) {
while (true) { // eslint-disable-line no-constant-condition
var result = endConditionCallback(hierarchy, instanceIndex);
if (defined(result)) {
// The end condition was met, stop the traversal and return the result
Expand Down
12 changes: 6 additions & 6 deletions Source/Scene/Cesium3DTilesetTraversal.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ define([
this.internalDFS.frameState = this.frameState;
this.internalDFS.outOfCore = this.outOfCore;
this.internalDFS.baseScreenSpaceError = this.baseScreenSpaceError;
DFS(root, this);
depthFirstSearch(root, this);
};

BaseTraversal.prototype.visitStart = function(tile) {
Expand Down Expand Up @@ -378,7 +378,7 @@ define([

InternalBaseTraversal.prototype.execute = function(root) {
this.allLoaded = true;
DFS(root, this);
depthFirstSearch(root, this);
return this.allLoaded;
};

Expand Down Expand Up @@ -433,7 +433,7 @@ define([
this.internalDFS.outOfCore = outOfCore;

this.maxChildrenLength = 0;
BFS(root, this);
breadthFirstSearch(root, this);
this.queue1.length = 0;
this.queue2.length = 0;
this.scratchQueue.length = 0;
Expand Down Expand Up @@ -476,7 +476,7 @@ define([
this.tileset = root._tileset;
this.root = root;
this.queue = queue;
DFS(root, this);
depthFirstSearch(root, this);
};

InternalSkipTraversal.prototype.visitStart = function(tile) {
Expand Down Expand Up @@ -736,7 +736,7 @@ define([
return tile.refine === Cesium3DTileRefine.ADD && tile.hasRenderableContent;
}

function DFS(root, options) {
function depthFirstSearch(root, options) {
var stack = options.stack;

if (defined(root) && (!defined(options.shouldVisit) || options.shouldVisit(root))) {
Expand Down Expand Up @@ -769,7 +769,7 @@ define([
stack.trim(maxLength);
}

function BFS(root, options) {
function breadthFirstSearch(root, options) {
var queue1 = options.queue1;
var queue2 = options.queue2;

Expand Down
22 changes: 11 additions & 11 deletions Source/Scene/Expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ define([
//>>includeStart('debug', pragmas.debug);
throw new DeveloperError('Operator "-" requires a vector or number argument. Argument is ' + left + '.');
//>>includeEnd('debug');
return -left; // jshint ignore:line
return -left; // eslint-disable-line no-unreachable
};

Node.prototype._evaluatePositive = function(frameState, feature) {
Expand Down Expand Up @@ -1329,7 +1329,7 @@ define([
throw new DeveloperError('Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ' + left + ' and ' + right + '.');
//>>includeEnd('debug');

return left + right; // jshint ignore:line
return left + right; // eslint-disable-line no-unreachable
};

Node.prototype._evaluateMinus = function(frameState, feature) {
Expand All @@ -1349,7 +1349,7 @@ define([
throw new DeveloperError('Operator "-" requires vector or number arguments of matching types. Arguments are ' + left + ' and ' + right + '.');
//>>includeEnd('debug');

return left - right; // jshint ignore:line
return left - right; // eslint-disable-line no-unreachable
};

Node.prototype._evaluateTimes = function(frameState, feature) {
Expand Down Expand Up @@ -1381,7 +1381,7 @@ define([
throw new DeveloperError('Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ' + left + ' and ' + right + '.');
//>>includeEnd('debug');

return left * right; // jshint ignore:line
return left * right; // eslint-disable-line no-unreachable
};

Node.prototype._evaluateDivide = function(frameState, feature) {
Expand All @@ -1407,7 +1407,7 @@ define([
throw new DeveloperError('Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ' + left + ' and ' + right + '.');
//>>includeEnd('debug');

return left / right; // jshint ignore:line
return left / right; // eslint-disable-line no-unreachable
};

Node.prototype._evaluateMod = function(frameState, feature) {
Expand All @@ -1427,7 +1427,7 @@ define([
throw new DeveloperError('Operator "%" requires vector or number arguments of matching types. Arguments are ' + left + ' and ' + right + '.');
//>>includeEnd('debug');

return left % right; // jshint ignore:line
return left % right; // eslint-disable-line no-unreachable
};

Node.prototype._evaluateEqualsStrict = function(frameState, feature) {
Expand Down Expand Up @@ -1545,7 +1545,7 @@ define([
throw new DeveloperError('Operator "=~" requires one RegExp argument and one string argument. Arguments are ' + left + ' and ' + right + '.');
//>>includeEnd('debug');

return false; // jshint ignore:line
return false; // eslint-disable-line no-unreachable
};

Node.prototype._evaluateRegExpNotMatch = function(frameState, feature) {
Expand All @@ -1562,7 +1562,7 @@ define([
throw new DeveloperError('Operator "!~" requires one RegExp argument and one string argument. Arguments are ' + left + ' and ' + right + '.');
//>>includeEnd('debug');

return false; // jshint ignore:line
return false; // eslint-disable-line no-unreachable
};

Node.prototype._evaluateRegExpExec = function(frameState, feature) {
Expand Down Expand Up @@ -1731,8 +1731,8 @@ define([
//>>includeStart('debug', pragmas.debug);
throw new DeveloperError('Error generating style shader: "' + value + '" is not supported.');
//>>includeEnd('debug');
// Return undefined when not in debug. Tell jsHint to ignore this line.
return undefined; // jshint ignore:line
// Return undefined when not in debug. Tell esLint to ignore this line.
return undefined; // eslint-disable-line no-unreachable
} else if (defined(unaryFunctions[value])) {
return value + '(' + left + ')';
}
Expand Down Expand Up @@ -1788,7 +1788,7 @@ define([
throw new DeveloperError('Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.');
}
//>>includeEnd('debug');
break;
break; // eslint-disable-line no-unreachable
case ExpressionNodeType.REGEX:
//>>includeStart('debug', pragmas.debug);
throw new DeveloperError('Error generating style shader: Regular expressions are not supported.');
Expand Down
4 changes: 2 additions & 2 deletions Source/Scene/PointCloud3DTileContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -1087,8 +1087,8 @@ define([
throw new DeveloperError('Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.');
//>>includeEnd('debug');

// In release silently ignore and recreate the shader without a style. Tell jsHint to ignore this line.
createShaders(content, frameState, undefined); // jshint ignore:line
// In release silently ignore and recreate the shader without a style. Tell esLint to ignore this line.
createShaders(content, frameState, undefined); // eslint-disable-line no-unreachable
}
}

Expand Down

0 comments on commit e0599a2

Please sign in to comment.