From a715a5fa37ab955b90472280bbbaca940f687de5 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 17 Apr 2014 21:41:45 -0700 Subject: [PATCH] Don't designate `\x85` as whitespace. --- lodash.js | 6 +++--- test/test.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lodash.js b/lodash.js index ebb2490b3..69d8a5e0b 100644 --- a/lodash.js +++ b/lodash.js @@ -86,7 +86,7 @@ /** Used to detect and test whitespace */ var whitespace = ( // whitespace - ' \t\x0B\f\x85\xA0\ufeff' + + ' \t\x0B\f\xA0\ufeff' + // line terminators '\n\r\u2028\u2029' + @@ -476,7 +476,7 @@ while (++index < length) { var c = string.charCodeAt(index); - if (!((c <= 160 && (c >= 9 && c <= 13) || c == 32 || c == 133 || c == 160) || c == 5760 || c == 6158 || + if (!((c <= 160 && (c >= 9 && c <= 13) || c == 32 || c == 160) || c == 5760 || c == 6158 || (c >= 8192 && (c <= 8202 || c == 8232 || c == 8233 || c == 8239 || c == 8287 || c == 12288 || c == 65279)))) { break; } @@ -495,7 +495,7 @@ var index = string.length; while (index--) { var c = string.charCodeAt(index); - if (!((c <= 160 && (c >= 9 && c <= 13) || c == 32 || c == 133 || c == 160) || c == 5760 || c == 6158 || + if (!((c <= 160 && (c >= 9 && c <= 13) || c == 32 || c == 160) || c == 5760 || c == 6158 || (c >= 8192 && (c <= 8202 || c == 8232 || c == 8233 || c == 8239 || c == 8287 || c == 12288 || c == 65279)))) { break; } diff --git a/test/test.js b/test/test.js index c2727dfdb..54e71f820 100644 --- a/test/test.js +++ b/test/test.js @@ -203,7 +203,7 @@ var shadowedObject = _.invert(shadowedProps); /** Used to check for problems removing whitespace */ - var whitespace = ' \t\x0B\f\x85\xA0\ufeff\n\r\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'; + var whitespace = ' \t\x0B\f\xA0\ufeff\n\r\u2028\u2029\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000'; /** * Removes all own enumerable properties from a given object. @@ -548,7 +548,7 @@ strictEqual(actual, true, message('String#contains')); } else { - skipTest(12); + skipTest(9); } }); }()); @@ -9328,7 +9328,7 @@ }); test('`_.' + methodName + '` should not remove non-whitespace characters', 1, function() { - var problemChars = '\u200b\ufffe', + var problemChars = '\x85\u200b\ufffe', string = problemChars + 'a b c' + problemChars; strictEqual(func(string), string);