...which of course kills any chance you had at getting the code optimized,
but if the fragments are short enough, they probably didn't get optimized
anyway (because "6+7" executes waaaay to quickly to be worth the overhead
of firing up the optimizing compiler), so this may not matter.

If you control the fragments, you could just change them to end with a
suitable "return whatever;" statement.


On Wed, Jul 16, 2014 at 1:30 PM, Sven Panne <svenpa...@chromium.org> wrote:

> On Wed, Jul 16, 2014 at 12:29 PM, Oliver Bock <oli...@g7.org> wrote:
>
>> Hi Jakob,
>>
>> This is a good idea, but unfortunately my existing code relies on the
>> eval-like nature of fragments, in that they "return" whatever the last line
>> in the script evaluates to.  [...]
>>
>
> Easily fixable via the highly readable one-liner:  :-D :-P * * *
>
>    function myEval(body){"use strict"; return eval("(function(){return
> eval(\""+body+"\");})()")}
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to