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

class declaration in a function with argument causes Compiler bug: Lexical declaration for an unbound name #530

Closed
mstoykov opened this issue Aug 28, 2023 · 1 comment
Labels

Comments

@mstoykov
Copy link
Contributor

Basically what the topic says.

The following script:

function as(requiredArgument = {}) { // removing the argument seems to work
	class something { }
	let l = new something() // not required
};

gets you

SyntaxError: Compiler bug: Lexical declaration for an unbound name at file:///home/mstoykov/work/k6io/k6/winston.js:3:2

Originally reported in https://stackoverflow.com/questions/76915364/k6-could-not-initialize-path-syntaxerror-compiler-bug-lexical-declaration

@romanshevchenkokwiff
Copy link

🔥

Gabri3l pushed a commit to Gabri3l/goja that referenced this issue Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants