Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strangely formatted output #196

Closed
stuffaboutpete opened this issue Apr 1, 2019 · 4 comments
Closed

Strangely formatted output #196

stuffaboutpete opened this issue Apr 1, 2019 · 4 comments

Comments

@stuffaboutpete
Copy link

Can anyone explain this output?

const { VM } = require('vm2');
console.log(new VM().run('[1, 2, 3]'));
[ 1, 2, 3, '0': 1, '1': 2, '2': 3 ]

The equivalent eval looks like this (as you'd expect)...

console.log(eval('[1, 2, 3]'));
[ 1, 2, 3 ]
@stale
Copy link

stale bot commented Jun 30, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stuffaboutpete
Copy link
Author

Thanks @patriksimek, I'm still interested in an answer if someone has any insight.

@OleksiyRudenko
Copy link

@stuffaboutpete check #198 out.
One of workarounds is to downgrade Node to v8.10.0

@stuffaboutpete
Copy link
Author

Thank you @OleksiyRudenko. I'll close as these are definitely duplicates.

Plus, that workaround is useful for me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants