Skip to content

Commit ac9d0ed

Browse files
committed
fix: "this" was not String.prototype
1 parent d02bfc7 commit ac9d0ed

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

source/polyfill.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ if (String.prototype.includes === undefined) {
9191
* https://stackoverflow.com/a/2308168
9292
*/
9393
if (String.prototype.trimLeft === undefined) {
94-
String.prototype.trimLeft = () => {
94+
// tslint:disable-next-line: space-before-function-paren
95+
String.prototype.trimLeft = function (): string {
9596
return this.replace(/^\s+/, '');
9697
};
9798
}
@@ -101,7 +102,8 @@ if (String.prototype.trimLeft === undefined) {
101102
* https://stackoverflow.com/a/2308168
102103
*/
103104
if (String.prototype.trimRight === undefined) {
104-
String.prototype.trimRight = () => {
105+
// tslint:disable-next-line: space-before-function-paren
106+
String.prototype.trimRight = function (): string {
105107
return this.replace(/^\s+/, '');
106108
};
107109
}

0 commit comments

Comments
 (0)