-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Unused prototype objects from V8 FunctionTemplate initialization #17668
Comments
Hello, I'd like to work on this! Any tips on where I should look? |
@brandonrninefive I think |
@addaleax Great! Thank you. I think I've figured out how this works. The For clarification regarding this exact issue, am I just getting rid of the last Or am getting rid of that prototype and also the I appreciate the help, and please let me know if any of my above conclusions are incorrect. |
@brandonrninefive My recommendation is that you do not use
With regards to your last question, you are only getting rid of the last prototype. If you look at built-in methods like |
@TimothyGu Thank you for all the tips! I'm working on implementing this now, and I should have a PR ready over the next few days. |
Added an optional parameter of type v8::ConstructorBehavior to Environment::NewFunctionTemplate, defaulting to v8::ConstructorBehavior::kAllow. Also modified Environment::SetProtoMethod to pass v8::ConstructorBehavior::kThrow to its call to Environment::NewFunctionTemplate. Fixes: nodejs#17668 Refs: nodejs#20321
Added an optional parameter of type v8::ConstructorBehavior to Environment::NewFunctionTemplate, defaulting to v8::ConstructorBehavior::kAllow. Also modified Environment::SetProtoMethod to pass v8::ConstructorBehavior::kThrow to its call to Environment::NewFunctionTemplate. Fixes: #17668 Refs: #20321 PR-URL: #20321 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Added an optional parameter of type v8::ConstructorBehavior to Environment::NewFunctionTemplate, defaulting to v8::ConstructorBehavior::kAllow. Also modified Environment::SetProtoMethod to pass v8::ConstructorBehavior::kThrow to its call to Environment::NewFunctionTemplate. Fixes: #17668 Refs: #20321 PR-URL: #20321 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Added an optional parameter of type v8::ConstructorBehavior to Environment::NewFunctionTemplate, defaulting to v8::ConstructorBehavior::kAllow. Also modified Environment::SetProtoMethod to pass v8::ConstructorBehavior::kThrow to its call to Environment::NewFunctionTemplate. Fixes: #17668 Refs: #20321 PR-URL: #20321 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
We don't need these prototypes, and we can get rid of them either through
v8::FunctionTemplate::RemovePrototype()
or indirectly, by specifyingv8::ConstructorBehavior::kThrow
when creating thev8::FunctionTemplate
.The text was updated successfully, but these errors were encountered: