File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 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,
@@ -74,7 +75,7 @@ const CONVERTER_FLAGS_IGNORE_BOM = 0x4;
74
75
75
76
const empty = new Uint8Array ( 0 ) ;
76
77
77
- const encodings = new Map ( [
78
+ const encodings = new SafeMap ( [
78
79
[ 'unicode-1-1-utf-8' , 'utf-8' ] ,
79
80
[ 'utf8' , 'utf-8' ] ,
80
81
[ 'utf-8' , 'utf-8' ] ,
@@ -309,7 +310,7 @@ function trimAsciiWhitespace(label) {
309
310
label [ e - 1 ] === '\u0020' ) ) {
310
311
e -- ;
311
312
}
312
- return label . slice ( s , e ) ;
313
+ return StringPrototypeSlice ( label , s , e ) ;
313
314
}
314
315
315
316
function getEncodingFromLabel ( label ) {
@@ -504,7 +505,7 @@ function makeTextDecoderJS() {
504
505
// If the very first result in the stream is a BOM, and we are not
505
506
// explicitly told to ignore it, then we discard it.
506
507
if ( result [ 0 ] === '\ufeff' ) {
507
- result = result . slice ( 1 ) ;
508
+ result = StringPrototypeSlice ( result , 1 ) ;
508
509
}
509
510
this [ kBOMSeen ] = true ;
510
511
}
You can’t perform that action at this time.
0 commit comments