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.

fail to run js code

See original GitHub issue

Thanks for your work!

When I tried to run a piece of code, I got SyntaxError: Identifier 'a' has already been declared.

And I tried all ecmaVer.

Here is the code: jsbin

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Llorxcommented, Dec 11, 2019

I’m so sorry but I was trying to solve obfuscated code with sval, I do not have the raw source code.

At least you can try to pretty-print it…

The problem is in the _k function: image

var variables should be able to be redefined. let and const are the ones not allowed to be redefined. I don’t know if that’s something about strict mode also.

0reactions
Llorxcommented, May 7, 2020

Maybe there’s a chance to catch eval calls and run them though sval.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - unable to run javascript code in visual studio code
I get the following error: "[Running] node "c:\Users\boyce\Documents\javascript visual studio code\scratchpad-1.js" 'node' is ...
Read more >
What went wrong? Troubleshooting JavaScript - MDN Web Docs
In this case, the code was not run and the error was not thrown until the checkGuess() function was run by line 86....
Read more >
5 Common Causes of JavaScript Errors (and How to Avoid ...
Syntax errors take place when the JavaScript interpreter fails to execute a syntactically incorrect code. If creating an application and the interpreter ...
Read more >
How to run JavaScript Programs (with examples)? - Tools QA
This article covers How does JavaScript run in a web-browser? How to embed and execute and diagnose an error in JavaScript in a...
Read more >
JavaScript Programming with Visual Studio Code
Tip: To check if a JavaScript file is part of JavaScript project, just open the file in VS Code and run the JavaScript:...
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