nodyn / jvm-npm

NPM compliant CommonJS module loader for the JVM
Other
180 stars 46 forks source link

Problem requiring sax.js from xmldom. Puzzled. #38

Open coderextreme opened 7 years ago

coderextreme commented 7 years ago
$ jjs xxx.js
Cannot load module sax LOAD_ERROR
./jvm-npm.js:109:8 SyntaxError: <function>:102:31 Missing close quote
                                var end = source.indexOf('>

=================================================================== xxx.js

load('./jvm-npm.js');
var x = require('sax');

=================================================================== https://github.com/jindw/xmldom/blob/master/sax.js

The sax.js file appears to be truncated.

coderextreme commented 7 years ago

I've tracked this down to the pattern in useDelimiter("\A"). It only matches a 4096 byte long string. the files are long than that. I will do some experimentation, but it looks like a flaw in the JVM.