From f9b226a820f3d7fe01c7ddc28c36da4d1760c09a Mon Sep 17 00:00:00 2001 From: Yaroslaff Fedin Date: Sun, 25 Jan 2015 00:12:56 +0800 Subject: [PATCH] use Object.prototype.toString --- lib/grammar.js | 4 ++-- src/grammar.coffee | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 ''