question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Google closure-compiler goes a bit haywire for stuff like this :

input :

const SomeFunc = (i,k,x) => i * i + k * x
console.log(someFunc(2))
someFunc(3)
someFunc(10)
someFunc(21)
someFunc(123)
someFunc(12314)
someFunc(123144)

Output :

console.log(someFunc(2));someFunc(3);someFunc(10);someFunc(21);someFunc(123);someFunc(12314);someFunc(123144);

The only happens when I run this on advanced optimization

On a side note : ES5+ is not supported even though we are now well on our way to ES9 ? (Kindly implement some basic ES6 functionalities).

For now this happens :

const xyz = () => // the whole code you know what

compiles to

var xyz = function() {};

Similarly spread operators , string literals or any other ES5+ functionality is not supported at all.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
lazarljubenoviccommented, May 8, 2018

It’s not about Closure, it’s just JS. Identifiers are case sensitive.

1reaction
lazarljubenoviccommented, May 8, 2018

Closure sees that you do not use SomeFunc, so it removes it. It analyzes the code and in order to minify is properly it has to be correct JavaScript. It’s done exactly what it was supposed to do in your example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HayWired Scenario | U.S. Geological Survey - USGS.gov
The HayWired scenario depicts a scientifically realistic earthquake sequence, and its cascading impacts, that all starts with a magnitude 7 ...
Read more >
HayWired | U.S. Geological Survey - USGS.gov
The HayWired scenario examines a hypothetical earthquake (mainshock) with a moment magnitude of 7.0 occurring on April 18, 2018, at 4:18 p.m. on...
Read more >
The HayWired Earthquake Scenario: How We Can Outsmart ...
The name HayWired speaks to the threat of earthquakes on the Hayward Fault and to the vulnerabilities and strengths posed by the ...
Read more >
Meaning of haywire in English - Cambridge Dictionary
haywire meaning: 1. to stop working, often in a way that is very sudden and noticeable: 2. to stop working, often…. Learn more....
Read more >
The Haywired Scenario Exercise Toolkit will be available soon!
The USGS HayWired Earthquake Scenario explores the physical, technological, and societal impacts of a hypothetical magnitude-7.0 earthquake on the Hayward ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found