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

Remove dead code #384

Closed
wants to merge 1 commit into from
Closed

Remove dead code #384

wants to merge 1 commit into from

Conversation

oterral
Copy link

@oterral oterral commented Jun 18, 2019

In our project https://github.com/geops/openlayer-editor, we use jsts as es6 import and after compilation we have this issue in the browser console:

Uncaught SyntaxError: Identifier 't' has already been declared

2 generated variables by the compiler have the same name .
It seems it' caused by some dead code in DirectedEdgeStar.js, Removing it fix our issue.

@codecov
Copy link

codecov bot commented Jun 18, 2019

Codecov Report

Merging #384 into master will decrease coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #384      +/-   ##
==========================================
- Coverage   62.46%   62.45%   -0.01%     
==========================================
  Files         280      280              
  Lines       14327    14325       -2     
==========================================
- Hits         8949     8947       -2     
  Misses       5378     5378
Impacted Files Coverage Δ
...org/locationtech/jts/geomgraph/DirectedEdgeStar.js 82.38% <ø> (-0.22%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efe352b...211483c. Read the comment docs.

@bjornharrtell
Copy link
Owner

Nice catch, but I'd like to fix this upstream.

@bjornharrtell
Copy link
Owner

Ah.. I see the issue is caused by that the same local var name is in overloads.. this is of course nothing illegal in Java so it's a transpilation issue but seemingly rare.

@oterral
Copy link
Author

oterral commented Jun 18, 2019

java is more permissive than js , the world becomes crazy :D

@oterral
Copy link
Author

oterral commented Jun 18, 2019

Thx to have fix this upstream !!

@bjornharrtell
Copy link
Owner

Fixed by d74c9ce

@oterral
Copy link
Author

oterral commented Jun 21, 2019

Hi @bjornharrtell ! when did you plan the next release of jsts?

@bjornharrtell
Copy link
Owner

Don't know ;)

@bjornharrtell
Copy link
Owner

I note that there are many more instances of duplicate declarations due to an oversight in the transpiration that I'd like to fix but unfortunately it is not trivial. I wonder why this particular instance cause you trouble and others not though ..

@bjornharrtell
Copy link
Owner

Underlying issue tracked by #386

@oterral
Copy link
Author

oterral commented Jun 27, 2019

Probably because we don't use all the library. Where have you seen the same kind of duplicat declarations ? , I can have a look how it's transpiled in our code.

@bjornharrtell
Copy link
Owner

On latest master you can run yarn lint and it will give you a large list of duplicate declarations (and some other issues) starting with:

jsts/src/org/locationtech/jts/algorithm/Area.js
39:11 error 'x0' is already defined no-redeclare
41:11 error 'sum' is already defined no-redeclare
42:16 error 'i' is already defined no-redeclare
...

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.

2 participants