@@ -141,9 +141,9 @@ export function preprocess(filename) {
141141 showStack . push ( truthy ? SHOW : IGNORE ) ;
142142 } else if ( first === '#include' ) {
143143 if ( showCurrentLine ( ) ) {
144- let includeFile = line . substr ( line . indexOf ( ' ' ) + 1 ) ;
144+ let includeFile = line . slice ( line . indexOf ( ' ' ) + 1 ) ;
145145 if ( includeFile . startsWith ( '"' ) ) {
146- includeFile = includeFile . substr ( 1 , includeFile . length - 2 ) ;
146+ includeFile = includeFile . slice ( 1 , - 1 ) ;
147147 }
148148 const absPath = findIncludeFile ( includeFile , path . dirname ( filename ) ) ;
149149 if ( ! absPath ) {
@@ -328,7 +328,7 @@ function getNativeTypeSize(type) {
328328 return POINTER_SIZE ;
329329 }
330330 if ( type [ 0 ] === 'i' ) {
331- const bits = Number ( type . substr ( 1 ) ) ;
331+ const bits = Number ( type . slice ( 1 ) ) ;
332332 assert ( bits % 8 === 0 , `getNativeTypeSize invalid bits ${ bits } , ${ type } type` ) ;
333333 return bits / 8 ;
334334 }
@@ -360,7 +360,7 @@ function ensureDot(value) {
360360 if ( value . includes ( '.' ) || / [ I N ] / . test ( value ) ) return value ;
361361 const e = value . indexOf ( 'e' ) ;
362362 if ( e < 0 ) return value + '.0' ;
363- return value . substr ( 0 , e ) + '.0' + value . substr ( e ) ;
363+ return value . slice ( 0 , e ) + '.0' + value . slice ( e ) ;
364364}
365365
366366export function isNumber ( x ) {
@@ -406,7 +406,7 @@ function asmFloatToInt(x) {
406406}
407407
408408// See makeSetValue
409- function makeGetValue ( ptr , pos , type , noNeedFirst , unsigned , ignore , align ) {
409+ function makeGetValue ( ptr , pos , type , noNeedFirst , unsigned , _ignore , align ) {
410410 assert ( typeof align === 'undefined' , 'makeGetValue no longer supports align parameter' ) ;
411411 assert (
412412 typeof noNeedFirst === 'undefined' ,
@@ -551,7 +551,7 @@ function getFastValue(a, op, b) {
551551
552552 if ( b [ 0 ] === '-' ) {
553553 op = '-' ;
554- b = b . substr ( 1 ) ;
554+ b = b . slice ( 1 ) ;
555555 }
556556
557557 return `(${ a } )${ op } (${ b } )` ;
@@ -785,14 +785,14 @@ export function modifyJSFunction(text, func) {
785785 if ( match ) {
786786 async_ = match [ 1 ] || '' ;
787787 args = match [ 3 ] ;
788- rest = text . substr ( match [ 0 ] . length ) ;
788+ rest = text . slice ( match [ 0 ] . length ) ;
789789 } else {
790790 // Match an arrow function
791791 let match = text . match ( / ^ \s * ( v a r ( \w + ) = ) ? ( a s y n c \s + ) ? \( ( [ ^ ) ] * ) \) \s + = > \s + / ) ;
792792 if ( match ) {
793793 async_ = match [ 3 ] || '' ;
794794 args = match [ 4 ] ;
795- rest = text . substr ( match [ 0 ] . length ) ;
795+ rest = text . slice ( match [ 0 ] . length ) ;
796796 rest = rest . trim ( ) ;
797797 oneliner = rest [ 0 ] != '{' ;
798798 } else {
@@ -802,7 +802,7 @@ export function modifyJSFunction(text, func) {
802802 assert ( match , `could not match function:\n${ text } \n` ) ;
803803 async_ = match [ 1 ] || '' ;
804804 args = match [ 2 ] ;
805- rest = text . substr ( match [ 0 ] . length ) ;
805+ rest = text . slice ( match [ 0 ] . length ) ;
806806 }
807807 }
808808 let body = rest ;
0 commit comments