Skip to content

Commit

Permalink
use Object.prototype.toString
Browse files Browse the repository at this point in the history
  • Loading branch information
Inviz committed Jan 24, 2015
1 parent 1b6e54d commit f9b226a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
Expand Down
4 changes: 2 additions & 2 deletions src/grammar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''


Expand Down

0 comments on commit f9b226a

Please sign in to comment.