Skip to content

Issues while using Google Closure Compiler on plotly-cartesian-1.57.1.js #5289

Closed
@COLLINETTEBastien

Description

@COLLINETTEBastien

Hello !

I didn't know if I had to post this in the forum or here, but since I think that what I found could result in fixes, I have chosen to post this here.
I am using plotly-cartesian-1.57.1.js (which is currently the latest version of Plotly Cartesian) not minified and I tried Google's Closure Compiler on it.
It resulted what might be some issues in the code :

-line 584: unreachable code
return false;
That return may be unnecessary since it's just after an if-else condition that both throw an error.

-line 3807: Suspicious code. The result of the 'not' operator is not being used.
!function() {
Is the ! necessary?

-line 69736: Suspicious code. This code lacks side-effects. Is there a bug?
if(!locale) locale === 'en-US';
-line 69736: Suspicious code. The result of the 'sheq' operator is not being used.
if(!locale) locale === 'en-US';
Shouldn't it be if(!locale) locale = 'en-US'; instead?

-line 87184: unreachable code
for(i = 0; i < traces.length; i++) {
Since this for loop contains a break; that cannot be avoided, is it relevant to use a for loop to only do things with i==0 while i < traces.length?

Is it me that (surely) didn't understand what the code does at these lines or these are real issues / oversights?

As always, thank you very much for your hard work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugsomething broken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions