@@ -261,7 +261,7 @@ suite('Jerry Utils', () => {
261
261
262
262
test ( 'returns empty array for empty string, and vice versa' , ( ) => {
263
263
assert . strictEqual ( cesu8ToString ( new Uint8Array ( 0 ) ) , '' ) ;
264
- assert . deepStrictEqual ( stringToCesu8 ( '' , 5 , defConfig ) , new Uint8Array ( 0 ) ) ;
264
+ assert . deepStrictEqual ( stringToCesu8 ( '' , 0 , defConfig ) , new Uint8Array ( 0 ) ) ;
265
265
} ) ;
266
266
267
267
test ( 'returns ASCII from ASCII' , ( ) => {
@@ -271,7 +271,7 @@ suite('Jerry Utils', () => {
271
271
array [ i ] = sentence . charCodeAt ( i ) ;
272
272
}
273
273
assert . deepStrictEqual ( cesu8ToString ( array ) , sentence ) ;
274
- assert . deepStrictEqual ( stringToCesu8 ( sentence , 5 , defConfig ) , array ) ;
274
+ assert . deepStrictEqual ( stringToCesu8 ( sentence , 0 , defConfig ) , array ) ;
275
275
} ) ;
276
276
277
277
test ( 'acts like UTF-8 for two-byte encodings' , ( ) => {
@@ -281,8 +281,8 @@ suite('Jerry Utils', () => {
281
281
const highTwoByte = Uint8Array . from ( [ 0xc0 + 0x1f , 0x80 + 0x3f ] ) ;
282
282
assert . deepStrictEqual ( cesu8ToString ( lowTwoByte ) , String . fromCharCode ( 0x80 ) ) ;
283
283
assert . deepStrictEqual ( cesu8ToString ( highTwoByte ) , String . fromCharCode ( 0x7ff ) ) ;
284
- assert . deepStrictEqual ( stringToCesu8 ( String . fromCharCode ( 0x80 ) , 5 , defConfig ) , lowTwoByte ) ;
285
- assert . deepStrictEqual ( stringToCesu8 ( String . fromCharCode ( 0x7ff ) , 5 , defConfig ) , highTwoByte ) ;
284
+ assert . deepStrictEqual ( stringToCesu8 ( String . fromCharCode ( 0x80 ) , 0 , defConfig ) , lowTwoByte ) ;
285
+ assert . deepStrictEqual ( stringToCesu8 ( String . fromCharCode ( 0x7ff ) , 0 , defConfig ) , highTwoByte ) ;
286
286
} ) ;
287
287
288
288
test ( 'acts like UTF-8 for three-byte encodings' , ( ) => {
@@ -292,8 +292,8 @@ suite('Jerry Utils', () => {
292
292
const highThreeByte = Uint8Array . from ( [ 0xe0 + 0x0f , 0x80 + 0x3f , 0x80 + 0x3f ] ) ;
293
293
assert . deepStrictEqual ( cesu8ToString ( lowThreeByte ) , String . fromCharCode ( 0x0800 ) ) ;
294
294
assert . deepStrictEqual ( cesu8ToString ( highThreeByte ) , String . fromCharCode ( 0xffff ) ) ;
295
- assert . deepStrictEqual ( stringToCesu8 ( String . fromCharCode ( 0x0800 ) , 5 , defConfig ) , lowThreeByte ) ;
296
- assert . deepStrictEqual ( stringToCesu8 ( String . fromCharCode ( 0xffff ) , 5 , defConfig ) , highThreeByte ) ;
295
+ assert . deepStrictEqual ( stringToCesu8 ( String . fromCharCode ( 0x0800 ) , 0 , defConfig ) , lowThreeByte ) ;
296
+ assert . deepStrictEqual ( stringToCesu8 ( String . fromCharCode ( 0xffff ) , 0 , defConfig ) , highThreeByte ) ;
297
297
} ) ;
298
298
299
299
test ( 'decodes UTF-16 surrogate pairs' , ( ) => {
@@ -306,7 +306,7 @@ suite('Jerry Utils', () => {
306
306
0xe0 + 0x0d , 0x80 + 0x38 , 0x80 + 0x02 ,
307
307
] ) ;
308
308
assert . deepStrictEqual ( cesu8ToString ( surrogatePairBytes ) , '😂' ) ;
309
- assert . deepStrictEqual ( stringToCesu8 ( '😂' , 5 , defConfig ) , surrogatePairBytes ) ;
309
+ assert . deepStrictEqual ( stringToCesu8 ( '😂' , 0 , defConfig ) , surrogatePairBytes ) ;
310
310
} ) ;
311
311
} ) ;
312
312
0 commit comments