keichi / binary-parser

A blazing-fast declarative parser builder for binary data
MIT License
868 stars 136 forks source link

Fix parsing result created in different context #139

Closed mohd-akram closed 4 years ago

mohd-akram commented 4 years ago

Fixes #138.

keichi commented 4 years ago

Thanks for pointing this out, @mohd-akram! The original intention of using runInNewContext() was to somewhat improve security since we are effectively calling eval() on a dynamically generated code. But now the node.js documentation says

The vm module is not a security mechanism. Do not use it to run untrusted code.

so I guess it wasn't really useful...