Message from JavaScript discussions
February 2017
— Can we see some code?
// Build a standalone Report - Constructor
Report: function () {
var entries = [];
var entryCount = 0;
this.entryCount = entryCount;
this.addEntry = function (entryText, title = "test") {
console.log(arguments);
entries.push({
msg: entryText,
title: title
});
this.entryCount++;
};
this.dumpReport = function (type = "log") {
fa.forEach(entries, function (loc, entry) {
debug.group(entry.title + ":");
debug[type](entry.msg);
debug.groupEnd();
});
};
},
— Constructed:
var report = new debug.Report();
— Invoked:
report.addEntry(exception, "In Action \"" + actionName + "\"");
— The issue happens in the first function, this.addEntry
— title
is test
even though there's a parameter there in the invokation
— Very odd stuff
— It must be something near that invokation specifically, I tried to reproduce it and couldnt
— Yes, I tried to reproduce and I can't
— Any guesses?
— Maybe you are forgetting the this parameter in call or bind
— I'm not using call or bind