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

Variable assignment on catch expression #233

Open
tronkko opened this issue Jan 12, 2016 · 0 comments
Open

Variable assignment on catch expression #233

tronkko opened this issue Jan 12, 2016 · 0 comments

Comments

@tronkko
Copy link

tronkko commented Jan 12, 2016

I have a JavaScript file:

$(document).on ('click', '#muokkaaKayttaja', function (e) {
    var teksti = "";
    vahvista (teksti, function () {
        try{
            var data = lahetaLomake ('muokkaaKayttaja', e);
            paivitaKayttaja (data);
        }
        catch (e) {
            virhe (e.message);
        }
    });
    return false;
});

Yuicompressor 2.4.8 produces:

$(document).on("click","#muokkaaKayttaja",function(b){var a="";vahvista(a,function(){try{var c=lahetaLomake("muokkaaKayttaja",d);paivitaKayttaja(c)}catch(d){virhe(d.message)}});return false});

which is wrong because the variable d is undefined when the function lahetaLomake is called. The problem goes away if I rename the variable e in the catch part to something else.

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