diff --git a/lib/error-reporter.js b/lib/error-reporter.js index 036a23d..cb2b955 100644 --- a/lib/error-reporter.js +++ b/lib/error-reporter.js @@ -2,8 +2,6 @@ var ErrorReporter, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; ErrorReporter = (function() { - ErrorReporter.prototype._toString = Object.prototype.toString; - ErrorReporter.prototype._sourceCode = null; function ErrorReporter(sourceCode) { @@ -11,7 +9,7 @@ ErrorReporter = (function() { if (sourceCode == null) { throw new Error('Source code not provided'); } - if (this._toString.call(sourceCode) !== '[object String]') { + if (Object.prototype.toString.call(sourceCode) !== '[object String]') { throw new TypeError('Source code must be a string'); } this._sourceCode = sourceCode; @@ -22,7 +20,7 @@ ErrorReporter = (function() { if (message == null) { throw new Error('Message not provided'); } - if (this._toString.call(message) !== '[object String]') { + if (Object.prototype.toString.call(message) !== '[object String]') { throw new TypeError('Message must be a string'); } if (message.length === 0) { @@ -31,7 +29,7 @@ ErrorReporter = (function() { if (lineNumber == null) { throw new Error('Line number not provided'); } - if (this._toString.call(lineNumber) !== '[object Number]') { + if (Object.prototype.toString.call(lineNumber) !== '[object Number]') { throw new TypeError('Line number must be a number'); } if (lineNumber <= 0) { @@ -40,7 +38,7 @@ ErrorReporter = (function() { if (columnNumber == null) { throw new Error('Column number not provided'); } - if (this._toString.call(columnNumber) !== '[object Number]') { + if (Object.prototype.toString.call(columnNumber) !== '[object Number]') { throw new TypeError('Column number must be a number'); } if (columnNumber <= 0) { @@ -92,4 +90,4 @@ ErrorReporter = (function() { })(); -module.exports = ErrorReporter; \ No newline at end of file +module.exports = ErrorReporter;