Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

call stack incorrectly labels non anonymous functions as anonymous #102

Closed
brenmar opened this Issue Jun 4, 2012 · 0 comments

Comments

Projects
None yet
2 participants

brenmar commented Jun 4, 2012

Traditional function declarations (function functionName(){}) are labeled as anonymous is the call stack despite being named.

Anonymous functions assigned to a variable are given the variable name as the function, but if the function also has a name then it also incorrectly appears as anonymous.

Code below illustrates the issue:

function test1() {
    // incorrectly thinks it's anonymous - should be test1
    debugger;
}

var test2 = function test2() {
    // incorrectly thinks it's anonymous - should be test2
    debugger;
}

var test2a = function test2b() {
    // incorrectly thinks it's anonymous - should probably be test2b
    // though some may say it should be test2a - probably an issue in it's self :)!
    debugger;
}

var test3 = function() {
    // correctly names as test3
    debugger;
}

var a = {
    test: function() {
        // correctly assigns it as a.test
        debugger;
    }
}

test1();
test2();
test2a();
test3();
a.test();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment