ascii-table
ascii-table copied to clipboard
global 'this' may not always be available, leading to breakage
In your last line, you pass 'this' context to a self-calling function. 'this' later gets used to append AsciiTable class to it. Normally, 'this' references the window object. Depending on how you load the script, however, 'this' could be undefined. One example is if you load the script via an eval. My solution was to change .call(this)
to .call(window)
, I suggest a similar fix for the version in this repo, or something like .call(window || global)
if it needs to work in node.