3 ms·
MMh. Using toString to serialize a JS function breaks for some functions doesn't it: https://github.com/mentum/lambdaws/blob/master/lib/LambdaHelper.js#L79 htt
by je42 12y ago
MMh. Using toString to serialize a JS function breaks for some functions doesn't it:
https://github.com/mentum/lambdaws/blob/master/lib/LambdaHelper.js#L79 https://github.com/mentum/lambdaws/blob/master/lib/LambdaHel...
It seems here is a discussion about the topic:
http://perfectionkills.com/state-of-function-decompilation-in-javascript/ http://perfectionkills.com/state-of-function-decompilation-i...
- _Marak_ 12y agoTo my understanding, this library is intended to run in a some-what fixed environment ( server-side node.js ). I'm unsure if you will run into any of the serialization issues mentioned by Kangax, as developers will be using the same ( if not very similar ) versions of v8.
- je42 12y agoTrue, but node.js would still screw up bound function's wouldn't it ? Thus if you want to schedule a function you would needed guarantee across all it's dependencies that bind hasn't been used. While this might not be a problem for some use cases, I guess at least the documentation could discuss the topic such that the users of the library use the functionality with the restrictions in mind.
- _lce0 12y agoI feel like there's no sane way for the developer to understand that he's runnning in a different evironment suppose: var i = 0; var localCaller = remoteBundler(function() { // this will be run at server-side i += 1; // oops .. "i" does not exists on server }); localCaller(); and yes, this is could be easily spotted, but I've seen so many guys really stuck with so naive errors (eg mongodb's reduce function)
- icebraining 12y agoCan't the library detect the closure? I'm pretty sure I could do this in Python.