How to retain or reacquire v8::ScriptCompiler::Source object?

已查看 19 次
跳至第一个未读帖子

Zac Hansen

未读,
2016年10月11日 18:49:112016/10/11
收件人 v8-users
I'd like to keep around the data in a v8::ScriptCompiler::Source object, but I see it has v8::Local objects in it, which means I can't just make a Global out of it (right?).

Is there some way to reacquire that object later or to keep it around indefinitely (outside of a handle scope)?

Thank you.

--Zac

Jochen Eisinger

未读,
2016年10月12日 03:17:202016/10/12
收件人 v8-users
you can get the ScriptOrigin from a v8::Function via GetScriptOrigin. You can also ToString a function to get the source, but you could as well create a global to the source.

--
--
v8-users mailing list
v8-u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zac Hansen

未读,
2016年10月12日 04:38:202016/10/12
收件人 v8-users
the stringification of a function doesn't get me back the entire source though.   That's what I need to send to chrome for debugging.

Jochen Eisinger

未读,
2016年10月18日 05:42:172016/10/18
收件人 v8-users
You'll need to keep a reference to the source yourself - either pass the string as an external string resource to v8 in the first place, or keep a persistent handle to the string.
回复全部
回复作者
转发
0 个新帖子