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

Compiler issues #254

Open
savethekiddes opened this issue Feb 10, 2023 · 1 comment
Open

Compiler issues #254

savethekiddes opened this issue Feb 10, 2023 · 1 comment

Comments

@savethekiddes
Copy link

savethekiddes commented Feb 10, 2023

array = ["oof", "lol", "test", "jip"]
for item in array:
    console.log(item)

compiles to

(function(){"use strict";function ՐՏ_Iterable(iterable){var tmp;if(iterable.constructor===[].constructor||iterable.constructor==="".constructor||(tmp=Array.prototype.slice.call(iterable)).length){return tmp||iterable}if(Set&&iterable.constructor===Set){return Array.from(iterable)}return Object.keys(iterable)}(function(){var __name__="__main__"var ՐՏitr1,ՐՏidx1;;var array,item;array=["oof","lol","test","jip"];ՐՏitr1=ՐՏ_Iterable(array);for(ՐՏidx1=0;ՐՏidx1<ՐՏitr1.length;ՐՏidx1++){item=ՐՏitr1[ՐՏidx1];console.log(item)}})();})();

Near var__name__="__main__" there's a random var (that has to be removed manually and subsituted with a comma). Any idea on why does this happen? Am I using the compiler wrong? Thanks

@mardon86
Copy link

try using -p / --prettify

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

No branches or pull requests

2 participants