[quickjs-devel] Re: Parse error with some popular javascript libraries

  • From: John Gardner <gardnerjohng@xxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Tue, 2 Jun 2020 06:16:57 +1000

Here's a more helpful description of the issue:

const cmap = new Uint16Array(32);
cmap[cmap.length] = 10;


Assigning to an out-of-bounds index of a TypedArray shouldn't raise an
exception; it should simply be ignored (other than returning the assigned
value in an expression):

const cmap = new Uint16Array(32);
console.log(cmap[cmap.length] = 10); // 10
console.log(cmap[cmap.length]);      // undefined


— Alhadis

On Tue, 2 Jun 2020 at 00:32, Geequ lim <geequlim@xxxxxxxxx> wrote:

The qjs throws errors when importing some javascript as below
TypeError: out-of-bound numeric index

Can reproduce the problem with sheetjs
https://github.com/SheetJS/sheetjs

import * as XLSL from "./xlsx.js";

TypeError: out-of-bound numeric index
    at build_tree (xlsx.js:2103)
    at <anonymous> (xlsx.js:2119)
    at _CFB (xlsx.js:2128)
    at make_xlsx_lib (xlsx.js:2578)
    at <anonymous> (xlsx.js:21386)


Other related posts: