js/core/js/sccore.js
// Note that dim is 0 based - so a 1D array has dim = 0 (as per logic in BinaryExpression, JSTypeParameters, and NewExpression)
Note that dim is 0 based - so a 1D array has dim = 0 (as per logic in BinaryExpression, JSTypeParameters, and NewExpression)
Note that dim is 0 based - so a 1D array has dim = 0 ( as per logic in BinaryExpression JSTypeParameters and NewExpression )
function sc_initArrDim(array, arrayClass, args, dim) {
   var len = Math.floor(args[1 + dim]);  
   var ndim = args.length - 2 - dim;
   if (dim == 0) {
      var res = new Array(len);
      sc_initArrayInt(arrayClass, ndim, res);
      array = res;
      for (var j = 0; j < len; j++) {
         if (arrayClass == Number_c)
            array[j] = 0;
         else
            array[j] = null; 
      }
   }
   else if (ndim > 0) {
      for (var i = 0; i < len; i++) {
         array[i] = sc_initArrDim(array, arrayClass, args, ++dim);
      }
   }
   return array;
}
function sc_initArrDim ( array , arrayClass , args , dim ) { var len = Math . floor ( args [ 1 + dim ] ) ; var ndim = args . length - 2 - dim ; if ( dim == 0 ) { var res = new Array ( len ) ; sc_initArrayInt ( arrayClass , ndim , res ) ; array = res ; for ( var j = 0 ; j < len ; j ++ ) { if ( arrayClass == Number_c ) array [ j ] = 0 ; else array [ j ] = null ; } } else if ( ndim > 0 ) { for ( var i = 0 ; i < len ; i ++ ) { array [ i ] = sc_initArrDim ( array , arrayClass , args , ++ dim ) ; } } return array ; }
Note that dim is 0 based - so a 1D array has dim = 0 (as per logic in BinaryExpression, JSTypeParameters, and NewExpression)
Note that dim is 0 based - so a 1D array has dim = 0 ( as per logic in BinaryExpression JSTypeParameters and NewExpression )
// skipping original arrayClass arg - len converted to an int just in case it needs to be...