Closed hildjj closed 6 months ago
Tests succeed on my end.
I'm not familiar with the issues in this PR. Is there something that I could test manually that is broken on main
and this one fixes?
This should fail on main, but pass on this branch:
echo "foo = '1'" | bin/peggy.js --format es -t 1
unless you run this branch on node 20.7 or earlier, then it should fail with a version error.
All of the interesting stuff is now in bin/fromMem.js
. It shouldn't actually be security-relevant, even though it looks like it. All of those gyrations are there so that import
and require
work relative to the output directory (which is the input directory by default).
This should fail on main, but pass on this branch:
echo "foo = '1'" | bin/peggy.js --format es -t 1
unless you run this branch on node 20.7 or earlier, then it should fail with a version error.
Apparently my version of Ubuntu ships with node version 18.13.0 so I get the expected failure. (Don't feel like messing around with updates right now...)
On main
I get:
Error running test
Unexpected token 'export'
Good, that works as expected. I like to use npm -g install nve
and nve 21 ./bin/peggy ...
to use different node versions without having to change what is installed globally.
Thanks!
$ echo "foo = '1'" | nve 21 node --experimental-vm-modules ./bin/peggy.js --format es -t 1
'1'
Allow testing of es modules. Fixes #399