-
-
Notifications
You must be signed in to change notification settings - Fork 521
Add function and object template factories #248
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
Add function and object template factories #248
Conversation
What about the 4-arg |
Right... I probably was looking at an old v8 header and must have missed it. Will add it later today... |
If it wasn't always available we can't really add it. Lowest common denominator and all. I just assumed it was. On January 19, 2015 11:17:51 AM EET, David Siegel [email protected] wrote:
|
Hm, I thought about that when implementing Just my opinion, though. |
Yes, where there is not too much work, backporting and emulating is all very good. Just want the external interface to be identical. I think that something correctly written in proper NAN should work on every supported version. It should not be that parts only work on certain versions. For that we should have new major versions of NAN that drop support for older nodes and break the API. i.e. NAN 1 is for 0.8+, NAN 2 for 0.10+, NAN 3 for 0.12+. But nothing is of course set in stone and I don't know how v8 will evolve in the future, this needs to be adapted to reality. io.js claims to update v8 more often, so maybe we have to follow that. Who knows... See e.g. #208 On January 19, 2015 12:58:53 PM EET, David Siegel [email protected] wrote:
|
Can't write a test for |
Just backport the constructor. It just creates a function template and returns the resulting function. I already checked. I can do it tonight... The length argument requires more doing, though.
Opt-in seems like the right thing to do (in general). Either with defines or by including additional/different headers.
|
If backporting works, that would be great. From what I have seen, it is usually impossible, as anything that uses v8 "internal" stuff needs to be in the correct classes, and they are all non-extendable. But, if it just does a Length argument might be impossible for above mentioned reasons. I'll take a quick glance at the code and see. I like opt-in too. As explicit as possible, that should guard against spurious bug reports for "broken" functionality. Still requires good documentation (better organized than what we currently have). |
Length can be done. It ultimately just does |
Unfortunately |
Crap. Maybe it's possible to use @bnoordhuis: Any suggestions? On Monday 19 January 2015 17:32:17 David Siegel wrote:
|
I guess it is new because it is part of the ES6 standard. Let status be DefinePropertyOrThrow(F, "length", PropertyDescriptor{[[Value]]: On Monday 19 January 2015 17:32:17 David Siegel wrote:
|
The actual v8 implementation seems to define the property through an accessor pair operating on an internal field of sorts at |
I want to get this merged so I can push the new versions. Waiting for backport of Unsure about whether |
Ack. Will finish it tonight. |
I found no (good) way to back port Ready for review. |
I think the extra length argument is quite messy, but I can't see a better way of doing it either. I agree with keeping it under the wraps until some future point, preferrably not having it clutter up the code for now. If absolutely necessary at some future point, we can add it in -- provided that no fully compatible solution shows up. |
I removed the length argument for now. I'll add another PR to discuss our options. |
Excellent. I'll merge this, do some testing and push out the new releases then. |
#if (NODE_MODULE_VERSION >= 12) | ||
Local<Function> f = NanNew<Function>(overloaded); | ||
(void)f; // not unused | ||
#endif |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
…te_factories Add function and object template factories
This popped up while working on #243.
Ready for review.