Another question:

I modified the function GlobalEval and put something that should
generate a JavaScript error on the first line.

I then compiled v8 and the d8 shell, (without error) and then ran an
eval command in d8 and it worked fine...

So I am wondering... how was this possible?  An obvious syntax error
introduced into the v8natives.js code seems to have no effect.

On Feb 28, 11:41 am, mcot <[email protected]> wrote:
> Is it possible to modify the v8natives.js file in the source to have
> it call functions defined in the global object?
>
> Lets take eval as an example:
>
>  131 function GlobalEval(x) {
>  132   if (!IS_STRING(x)) return x;
>  133
>  134   var global_receiver = %GlobalReceiver(global);
>  135   var this_is_global_receiver = (this === global_receiver);
>  136   var global_is_detached = (global === global_receiver);
>  137
>  138   if (!this_is_global_receiver || global_is_detached) {
>  139     throw new $EvalError('The "this" object passed to eval must '
> +
>  140                          'be the global object from which eval
> originated');
>  141   }
>
>     /* could I do this here? */
>     if (_someCallback) {
>           _someCallback(x)
>     }

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to