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

Wrong scope analysis for catch block scope #2499

Closed
hyf0 opened this issue Feb 25, 2024 · 2 comments · Fixed by #3050
Closed

Wrong scope analysis for catch block scope #2499

hyf0 opened this issue Feb 25, 2024 · 2 comments · Fixed by #3050
Assignees

Comments

@hyf0
Copy link
Contributor

hyf0 commented Feb 25, 2024

input

try {
	throw 'FAIL';
} catch (t) {
	var t = 'PASS';
	assert.strictEqual(t, 'PASS');
}

let a = 1;
let def = 'PASS2';
try {
	throw ['FAIL2', 'PASS1'];
} catch ({ [a]: b, 3: d = def }) {
	let a = 0,
		def = 'FAIL3';
	assert.strictEqual(b, 'PASS1');
	assert.strictEqual(d, 'PASS2');
}

def in d = def and a in [a]: b resolve to a wrong binding.

visualized scope id by #2498

try{
        throw 'FAIL';
}catch(t#2){
        var t#2 = 'PASS';
        assert.strictEqual(t#2, 'PASS');
}let a#0 = 1;
let def#0 = 'PASS2';
try{
        throw ['FAIL2', 'PASS1'];
}catch({[a#4]:b#4, 3:d#4=def#4}){
        let a#4 = 0, def#4 = 'FAIL3';
        assert.strictEqual(b#4, 'PASS1');
        assert.strictEqual(d#4, 'PASS2');
}
@Dunqing
Copy link
Member

Dunqing commented Feb 26, 2024

@hyf0
Copy link
Contributor Author

hyf0 commented Apr 12, 2024

ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants