Skip to content

Commit 3e8e3b6

Browse files
committed
Remove unnecessary String.trim shim
1 parent c7d2a92 commit 3e8e3b6

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Simplify build setup
1010
* Update to Node.js 6.9
1111
* Add sourcemap for minified version
12+
* Remove unused String.trim shim
1213

1314
1.1.1
1415
==

lib/shims.js

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -434,27 +434,6 @@ if (
434434
};
435435
}
436436

437-
// ES5 15.5.4.20
438-
// whitespace from: http://es5.github.io/#x15.5.4.20
439-
var ws = '\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003' +
440-
'\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028' +
441-
'\u2029\uFEFF';
442-
var zeroWidth = '\u200b';
443-
var wsRegexChars = '[' + ws + ']';
444-
var trimBeginRegexp = new RegExp('^' + wsRegexChars + wsRegexChars + '*');
445-
var trimEndRegexp = new RegExp(wsRegexChars + wsRegexChars + '*$');
446-
var hasTrimWhitespaceBug = StringPrototype.trim && (ws.trim() || !zeroWidth.trim());
447-
defineProperties(StringPrototype, {
448-
// http://blog.stevenlevithan.com/archives/faster-trim-javascript
449-
// http://perfectionkills.com/whitespace-deviations/
450-
trim: function trim() {
451-
if (this === void 0 || this === null) {
452-
throw new TypeError("can't convert " + this + ' to object');
453-
}
454-
return String(this).replace(trimBeginRegexp, '').replace(trimEndRegexp, '');
455-
}
456-
}, hasTrimWhitespaceBug);
457-
458437
// ECMA-262, 3rd B.2.3
459438
// Not an ECMAScript standard, although ECMAScript 3rd Edition has a
460439
// non-normative section suggesting uniform semantics and it should be

0 commit comments

Comments
 (0)