Permalink
Browse files

Fix util.squeeze (arguments.slice does not exist in most engines)

  • Loading branch information...
1 parent dfcd3bd commit 4815e535f2135531ab4c98bd21b1623a14861c91 Tom Robinson committed Oct 11, 2010
Showing with 1 addition and 1 deletion.
  1. +1 −1 packages/narwhal-lib/lib/narwhal/util.js
View
2 packages/narwhal-lib/lib/narwhal/util.js
@@ -907,7 +907,7 @@ exports.enquote = function (value, strictJson) {
* todo: i'm not sure if this works correctly without the second argument
*/
exports.squeeze = function (s) {
- var set = arguments.length > 0 ? "["+Array.prototype.join.call(arguments.slice(1), '')+"]" : ".|\\n",
+ var set = arguments.length > 0 ? "["+Array.prototype.slice.call(arguments, 1).join('')+"]" : ".|\\n",
regex = new RegExp("("+set+")\\1+", "g");
return s.replace(regex, "$1");

0 comments on commit 4815e53

Please sign in to comment.