-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault on object construction in JS (on PHP object) #15
Comments
@stesie this is an interesting one! I'm not sure what the mechanism is to expose a constructor to JS via the V8 engine. I'd guess this hasn't been covered in the current V8JS code, so this is likely to be a feature that isn't covered yet rather than a bug. |
Actually I don't mind if we call this a bug or feature or just issue. After all I stumbled over it, I actually don't need it, but for the moment just wanted to write it down since it crashes the process ... I guess we can't directly expose the constructor of the PHP class. The
The In that particular case we probably have to create a PHP class instance from v8js, running the PHP class'es I think I'll have a go to implement that the upcoming days, but will concentrate on issue #13 before, as that's more of a show-stopper to me :-) |
hey there, just wanted to let you know that I've started working on a fix to this issue. I already got it working basically, current version at https://github.com/stesie/v8js/commits/fix-constructor-call cheers, |
Hi again :-)
got another one, inspired by the function template thing ... the objects passed back to from PHP to JavaScript have a constructor attribute pointing to the constructor function (i.e. function template from before). If you call that one in JavaScript you get fresh extra objects, ... however if you call back to PHP everything crashes since v8js relies on the internal fields, which are not initialized however.
Example code, first showing use of constructor attribute in JavaScript, then with PHP & JavaScript in combination:
cheers,
stesie
The text was updated successfully, but these errors were encountered: