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

while循环内嵌switch continue造成的异常 #24

Closed
ShiLiuShu opened this issue Oct 28, 2021 · 0 comments
Closed

while循环内嵌switch continue造成的异常 #24

ShiLiuShu opened this issue Oct 28, 2021 · 0 comments

Comments

@ShiLiuShu
Copy link

ShiLiuShu commented Oct 28, 2021

var i = 1;
while(i){
    switch (i) {
        default:
            i = 0;
            continue;
    }
    console.log('after default')
}

在正常js执行环境下,continue会跳出while loop,不会输出console
然而通过eval5执行此段代码,continue仅跳出switch,会输出console

麻烦作者大大看下该种执行不一致的情况如何解决

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

1 participant