On Thu, Jan 7, 2016 at 3:49 PM, Hugh Fitzpatrick
<
hugh.fit...@gmail.com> wrote:
> For instance - I cannot access console.log(..) or use require.
>
> ... Any thoughts on getting these to work ? Can I combine *many* JS files
> in a snapshot ?
You can't use node.js specific code in snapshot creation.
I'm not sure about deserialization; certainly not at deserialization
time itself because any node.js specific logic won't have been
installed yet.
Functions exported by the snapshot in theory should be able to call
`console.log` (`console` is a global object that can be lazily
resolved) but IIRC, there are some restrictions on scope lookup in
serialized code that may prohibit that.
require() won't work, it's not a global and snapshot code doesn't run
in module context.