On 2013/10/18 13:24:05, Yury Semikhatsky wrote:
Is it possible to detect builtin functions based on their
v8::Function::ScriptId() property?
Does not seem so. This is how I had to modify my test to make it pass:
f = v8::Local<v8::Function>::Cast(CompileRun("Math.floor"));
CHECK_EQ(8, f->ScriptId());
f = v8::Local<v8::Function>::Cast(CompileRun("Object"));
CHECK_EQ(0, f->ScriptId());
f = v8::Local<v8::Function>::Cast(CompileRun("Object.__defineSetter__"));
CHECK_EQ(4, f->ScriptId());
f = v8::Local<v8::Function>::Cast(CompileRun("Array.prototype.toString"));
CHECK_EQ(5, f->ScriptId());
f = v8::Local<v8::Function>::Cast(CompileRun("function a() {}; a;"));
CHECK_EQ(21, f->ScriptId());
All script IDs are different.
https://codereview.chromium.org/27701002/
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" 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/groups/opt_out.