You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 29, 2024. It is now read-only.
Trying to extend bundled example to work with object, I'm not able to get value. Consider following code:
$isolate = new \V8\Isolate();
$context = new \V8\Context($isolate);
$source = new \V8\StringValue($isolate, "var say = function() {return {foo: 'bar'};}; say();");
$script = new \V8\Script($context, $source);
$result = $script->run($context);
echo$result->value() . PHP_EOL;
I understand that return value is no longer StringValue but ObjectValue instead. How do I properly get it's value?
My use-case is rendering VueJS app on server to implement server side rendering. For this, I need to execute some wrapper javascript and app itself on the server. This js code results in ObjectValue just like my example above. If I try to do $result->toString($context)->value() I get [object Object] which is not usable. What is a correct way to do this?