Hello there,
I am looking for a way to simulate the "Function.prototype.call"
functionality in V8 native code.
I would like to write something like this in plain V8 code:
*<script>*
*function quux(str) {*
* console.log(eval(str));*
*}*
*var foo={bar:1};*
*var bar=2;*
*quux.call(window, "this.bar");*
*quux.call(foo, "this.bar");*
*</script>*
(to print "2", then "1")
I am capable of producing the "2" result (since "window" acts as the global
object), but I cannot produce the "1" result.
My "eval" implementation is basically a compilation+execution of an
external script. I have not found a way to give it "foo" to serve as "this".
Any ideas?
--
--
v8-users mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.