Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eslint in 3D-tiles branch #5372

Merged
merged 1 commit into from
May 26, 2017
Merged

Fix eslint in 3D-tiles branch #5372

merged 1 commit into from
May 26, 2017

Conversation

hpinkos
Copy link
Contributor

@hpinkos hpinkos commented May 26, 2017

No description provided.

@@ -111,7 +111,7 @@ define([
var data = this._data;
var candidate = -1;

while (true) {
while (true) { // eslint-disable-line no-constant-condition
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I like the idea of while(true) in our code to begin with, but I guess this can be discussed in the 3d-tiles PR itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

Already noted in #5308 for Cesium3DTileBatchTable.js and could probably apply here as well.

CC @lilleyse

@@ -1198,7 +1198,7 @@ define([
//>>includeStart('debug', pragmas.debug);
throw new DeveloperError('Operator "-" requires a vector or number argument. Argument is ' + left + '.');
Copy link
Contributor

Choose a reason for hiding this comment

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

@lilleyse Shouldn't these be RuntimeError or has style validation already happened at this point? Assuming we change them to runtime errors, that would get rid of the elint error as well because the below returns would never happen.

Even if they are runtime errors, this code makes no sense, we know left is not a number from the above failed check but we are returning -left anyway?

Copy link
Contributor

Choose a reason for hiding this comment

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

They could be RuntimeError. I guess my usual thought process is that "the developer wrote a bad style, so throw a developer error", but maybe I need to rethink that.

Returning -left is a remnant from the time when the styling language was less type strict. It would let a style like -"5" actually become -5. I can fix that throughout now that the rules have changed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good.

In general, while Cesium is aggressive with developer errors in API calls, anything that deals with externally loading data should normally use RuntimeError instead (we need to do better about this all around).

@lilleyse lilleyse mentioned this pull request May 26, 2017
23 tasks
@mramato
Copy link
Contributor

mramato commented May 26, 2017

Since the original intent of this PR was to fix the eslint errors in 3d-tiles (which is currently broken), I'm going to merge it as-is. We'll address the other two comments as part of the 3d-tiles PR.

Thanks @hpinkos!

@mramato mramato merged commit e0599a2 into 3d-tiles May 26, 2017
@mramato mramato deleted the fix-eslint branch May 26, 2017 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants