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

Nested scopes don't seem to capture references #176

Open
romainmenke opened this issue Aug 10, 2024 · 2 comments · May be fixed by #138
Open

Nested scopes don't seem to capture references #176

romainmenke opened this issue Aug 10, 2024 · 2 comments · May be fixed by #138

Comments

@romainmenke
Copy link

function foo() {
	const a = 'a';

	return function() {
		console.log(typeof a); // `undefined`
		console.log(a); // ReferenceError: a is not defined
	}
}

foo()();
@romainmenke
Copy link
Author

Maybe fixed by : #138 ?

@BobVarioa
Copy link
Contributor

BobVarioa commented Aug 10, 2024

That specific instance should be fine, but it's only partially fixed by #138. That requires closures which were going to be implemented in a follow up PR

@BobVarioa BobVarioa linked a pull request Aug 10, 2024 that will close this issue
4 tasks
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 a pull request may close this issue.

2 participants