variável de objeto javascript fica indefinida dentro da função anônima

Então, eu não consigo entender por que a variávelthis.tasks fica indefinido dentro do ouvinte de evento add que tenho dentro do meu objeto de objetivo. Tenho a sensação de que pode ter algo a ver com programação assíncrona (que ainda não entendo completamente). Desculpe, eu sou um pouco de JS noob, mas se vocês pudessem me explicar o que estou fazendo de errado e qual poderia ser uma solução melhor, seria incrível! Obrigado.

function Goal(name) {
        this.gDiv =  document.createElement('div');
        this.name = name || "goal";
        this.tasks = document.createElement('ul');
        //Sets the styling and content and adds it to the parent element
        this.initialize = function() {
            this.gDiv.className = "default";
            this.gDiv.setAttribute("id", this.name);
            this.gDiv.innerHTML = this.name;
            elem.appendChild(this.gDiv);

            this.gDiv.parentNode.insertBefore(this.tasks, this.gDiv.nextSibling);
            this.tasks.style.display = "none";


        };  
        //Creates a list underneath the a dive associated with the Goal object
        this.addTask = function(task) {
            var newLi = document.createElement('li');
                newLi.innerHTML = task;
                this.tasks.appendChild(newLi);
        };

        this.gDiv.addEventListener('click', function(){
            alert(this.tasks);              
        });

    }

Obrigado pessoal! Todos vocês responderam à minha pergunta! Eu estava coçando minha cabeça por um tempo. Parabéns a todos!

questionAnswers(4)

yourAnswerToTheQuestion