| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1ed517c commit 6e338da
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,10 +4,11 @@ | |||
| 4 | 4 | // https://encoding.spec.whatwg.org | |
| 5 | 5 | ||
| 6 | 6 | const { | |
| 7 | - Map, | ||
| 8 | 7 | ObjectCreate, | |
| 9 | 8 | ObjectDefineProperties, | |
| 10 | 9 | ObjectGetOwnPropertyDescriptors, | |
| 10 | + SafeMap, | ||
| 11 | + StringPrototypeSlice, | ||
| 11 | 12 | Symbol, | |
| 12 | 13 | SymbolToStringTag, | |
| 13 | 14 | Uint32Array, | |
@@ -73,7 +74,7 @@ const CONVERTER_FLAGS_IGNORE_BOM = 0x4; | |||
| 73 | 74 | ||
| 74 | 75 | const empty = new Uint8Array(0); | |
| 75 | 76 | ||
| 76 | - const encodings = new Map([ | ||
| 77 | + const encodings = new SafeMap([ | ||
| 77 | 78 | ['unicode-1-1-utf-8', 'utf-8'], | |
| 78 | 79 | ['utf8', 'utf-8'], | |
| 79 | 80 | ['utf-8', 'utf-8'], | |
@@ -308,7 +309,7 @@ function trimAsciiWhitespace(label) { | |||
| 308 | 309 | label[e - 1] === '\u0020')) { | |
| 309 | 310 | e--; | |
| 310 | 311 | } | |
| 311 | - return label.slice(s, e); | ||
| 312 | + return StringPrototypeSlice(label, s, e); | ||
| 312 | 313 | } | |
| 313 | 314 | ||
| 314 | 315 | function getEncodingFromLabel(label) { | |
@@ -503,7 +504,7 @@ function makeTextDecoderJS() { | |||
| 503 | 504 | // If the very first result in the stream is a BOM, and we are not | |
| 504 | 505 | // explicitly told to ignore it, then we discard it. | |
| 505 | 506 | if (result[0] === '\ufeff') { | |
| 506 | - result = result.slice(1); | ||
| 507 | + result = StringPrototypeSlice(result, 1); | ||
| 507 | 508 | } | |
| 508 | 509 | this[kBOMSeen] = true; | |
| 509 | 510 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments