judofyr/duktape.rb — pull request #10 by josh (2014-12-09 23:41:24+00:00)
Title: Add option to skip ComplexObject values

The new native return values work pretty nice in ExecJS, but I had to add some recursive discarding for the complex objects.

https://github.com/sstephenson/execjs/commit/a8a2d802690d104b5a5d2f27664ecbe98d3bdbf2#diff-bc43e6b021a91fde65d4936200f67d67R21

It'd be nice if this could just be ignored on eval with an optional flag. I'm not really sure what to call it, just posted a test like `skip_complex: true`.

The flag should really mean JSON values only. So whatever rules `JSON.stringify({a:1, b:function(){}})` uses to discard, this should do the same. Maybe `json_values: true`, `json_strict: true`, something like that?

No implementation yet, but what do you think about the feature?