jed / lave

eval in reverse: stringifying all the stuff that JSON.stringify won't

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Native code cannot be serialized.

381510688 opened this issue · comments

var generate = require('escodegen').generate
var lave = require('lave')
var a = [function(){}, new Date, Math.abs, (function a() {console.log(this)}).bind(global)]
console.log(lave(a,{generate, format: 'module'}))

throw new Error('Native code cannot be serialized.')
^
Error: Native code cannot be serialized.
at getExpression (/Users/ligang/Downloads/node_modules/lave/index.js:156:17)
at getExpression (/Users/ligang/Downloads/node_modules/lave/index.js:190:25)
at lave (/Users/ligang/Downloads/node_modules/lave/index.js:13:20)
at Object. (/Users/ligang/Downloads/test_lave.js:4:13)
at Module._compile (internal/modules/cjs/loader.js:701:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
at Module.load (internal/modules/cjs/loader.js:600:32)
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
at Function.Module._load (internal/modules/cjs/loader.js:531:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)

getting same error