diff --git a/lib/grammar.js b/lib/grammar.js index 2d73ccd..58c303f 100644 --- a/lib/grammar.js +++ b/lib/grammar.js @@ -18,10 +18,10 @@ Grammar = (function() { /* Private*/ Grammar._toString = function(input) { - if (toString.call(input) === '[object String]') { + if (Object.prototype.toString.call(input) === '[object String]') { return input; } - if (toString.call(input) === '[object Array]') { + if (Object.prototype.toString.call(input) === '[object Array]') { return input.join(''); } return ''; diff --git a/src/grammar.coffee b/src/grammar.coffee index 0095516..5dc879c 100644 --- a/src/grammar.coffee +++ b/src/grammar.coffee @@ -23,8 +23,8 @@ class Grammar # method. # @_toString: (input) -> - return input if toString.call(input) is '[object String]' - return input.join('') if toString.call(input) is '[object Array]' + return input if Object.prototype.toString.call(input) is '[object String]' + return input.join('') if Object.prototype.toString.call(input) is '[object Array]' return ''