@@ -321,14 +321,14 @@ function caml_bytes_set(s, i, c) {
321
321
}
322
322
323
323
//Provides: jsoo_text_encoder
324
- var jsoo_text_encoder = new TextEncoder ( ) ;
324
+ var jsoo_text_encoder = new TextEncoder ( ) ;
325
325
326
326
//Provides: jsoo_text_decoder
327
- var jsoo_text_decoder = new TextDecoder ( ) ;
327
+ var jsoo_text_decoder = new TextDecoder ( ) ;
328
328
329
329
//Provides: caml_bytes_of_utf16_jsstring
330
330
//Requires: MlBytes, jsoo_text_encoder
331
- function caml_bytes_of_utf16_jsstring ( s ) {
331
+ function caml_bytes_of_utf16_jsstring ( s ) {
332
332
var a = jsoo_text_encoder . encode ( s ) ;
333
333
return new MlBytes ( 4 , a , a . length ) ;
334
334
}
@@ -337,8 +337,10 @@ function caml_bytes_of_utf16_jsstring (s) {
337
337
//Requires: caml_convert_string_to_bytes, jsoo_is_ascii
338
338
//Requires: caml_uint8_array_of_bytes
339
339
//Requires: jsoo_text_decoder
340
- function MlBytes ( tag , contents , length ) {
341
- this . t = tag ; this . c = contents ; this . l = length ;
340
+ function MlBytes ( tag , contents , length ) {
341
+ this . t = tag ;
342
+ this . c = contents ;
343
+ this . l = length ;
342
344
}
343
345
MlBytes . prototype . toString = function ( ) {
344
346
switch ( this . t ) {
@@ -356,12 +358,12 @@ MlBytes.prototype.toString = function () {
356
358
return this . c ;
357
359
}
358
360
} ;
359
- MlBytes . prototype . toUtf16 = function ( ) {
360
- if ( this . t == 9 ) return this . c ;
361
+ MlBytes . prototype . toUtf16 = function ( ) {
362
+ if ( this . t == 9 ) return this . c ;
361
363
var a = caml_uint8_array_of_bytes ( this ) ;
362
364
return jsoo_text_decoder . decode ( a ) ;
363
- }
364
- MlBytes . prototype . slice = function ( ) {
365
+ } ;
366
+ MlBytes . prototype . slice = function ( ) {
365
367
var content = this . t == 4 ? this . c . slice ( ) : this . c ;
366
368
return new MlBytes ( this . t , content , this . l ) ;
367
369
} ;
@@ -682,12 +684,12 @@ var jsoo_text_decoder_buff = new ArrayBuffer(1024);
682
684
//Requires: jsoo_text_decoder_buff
683
685
//If: js-string
684
686
function caml_jsstring_of_string ( s ) {
685
- if ( jsoo_is_ascii ( s ) ) return s ;
687
+ if ( jsoo_is_ascii ( s ) ) return s ;
686
688
var a =
687
- ( s . length <= jsoo_text_decoder_buff . length )
688
- ? Uint8Array ( jsoo_text_decoder_buff , 0 , s . length )
689
- : ( new Uint8Array ( s . length ) ) ;
690
- for ( var i = 0 ; i < s . length ; i ++ ) {
689
+ s . length <= jsoo_text_decoder_buff . length
690
+ ? new Uint8Array ( jsoo_text_decoder_buff , 0 , s . length )
691
+ : new Uint8Array ( s . length ) ;
692
+ for ( var i = 0 ; i < s . length ; i ++ ) {
691
693
a [ i ] = s . charCodeAt ( i ) ;
692
694
}
693
695
return jsoo_text_decoder . decode ( a ) ;
@@ -697,7 +699,7 @@ function caml_jsstring_of_string(s) {
697
699
//Requires: caml_string_of_array
698
700
//Requires: jsoo_text_encoder
699
701
//If: js-string
700
- function caml_string_of_jsstring ( s ) {
702
+ function caml_string_of_jsstring ( s ) {
701
703
var a = jsoo_text_encoder . encode ( s ) ;
702
704
return caml_string_of_array ( a ) ;
703
705
}
0 commit comments