Override Global Date Object

21 views
Skip to first unread message

Joel Scarfone

unread,
Jun 17, 2019, 2:33:23 PM6/17/19
to v8-users
Hi all! I want to customize a context to forge a different Date object when running a script. I tried setting a function template on an object template that would be used as the global object during context creation, where the function template was set with a Utf8Value created from the string "Date". This failed however, as it seems the date object created by default when creating a context overrides it. Any ideas?

Jakob Kummerow

unread,
Jun 17, 2019, 3:01:32 PM6/17/19
to v8-users
How about deleting the default Date object before replacing it?

On Mon, Jun 17, 2019 at 8:33 PM Joel Scarfone <joelrs...@gmail.com> wrote:
Hi all! I want to customize a context to forge a different Date object when running a script. I tried setting a function template on an object template that would be used as the global object during context creation, where the function template was set with a Utf8Value created from the string "Date". This failed however, as it seems the date object created by default when creating a context overrides it. Any ideas?

--
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/v8-users/57c2a11a-7d91-4a87-94d0-31f5dcace231%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joel Scarfone

unread,
Jun 17, 2019, 3:03:46 PM6/17/19
to v8-users
I remember thinking of that but then not going down that route, and now can not remember why i did not :s.

I'll give it a go, thanks!

On Monday, 17 June 2019 15:01:32 UTC-4, Jakob Kummerow wrote:
How about deleting the default Date object before replacing it?

On Mon, Jun 17, 2019 at 8:33 PM Joel Scarfone <joelrs...@gmail.com> wrote:
Hi all! I want to customize a context to forge a different Date object when running a script. I tried setting a function template on an object template that would be used as the global object during context creation, where the function template was set with a Utf8Value created from the string "Date". This failed however, as it seems the date object created by default when creating a context overrides it. Any ideas?

--
--
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-u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages