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

Error on windows (variable scope) #8

Open
Devidian opened this issue Apr 27, 2016 · 0 comments
Open

Error on windows (variable scope) #8

Devidian opened this issue Apr 27, 2016 · 0 comments

Comments

@Devidian
Copy link

Devidian commented Apr 27, 2016

I just tried to use your wrapper and got an error (solved it by myself, just for you to correct)
See this code:

    if (internals.isWin) {
        for (let i = 0; i < lines.length; ++i) {
            if (/^\s+1/.test(lines[i])) {
                break;
            }
        }
        lines.splice(0,i);
        lines.pop();
        lines.pop();
    }

"let i" scope is only in the for loop and cant be accessed in lines.splice. Exchange let with var solves the problem
Maybe lines.length instead of i would do it too i think

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