-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Calls to v8::Template::Set must not pass in non-primitive values #6216
Comments
I can investigate this next week. If anyone else is interested in investigating, feel free (but let me know). |
I checked earlier today. It looks like it's fairly straightforward to fix in core (don't know yet how or if it affects performance) but it's going to create a lot of fallout in the module ecosystem. Again. Le sigh. |
Yeah, if only node had a proper API ... |
V8 is going to disallow non-primitive values on v8::FunctionTemplate and v8::ObjectTemplate because those can't be shared across contexts. Fixes: nodejs#6216 PR-URL: nodejs#6228 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
When is the patch that causes this landing? Not in v6 right? |
It's part of v8 5.2 which @bnoordhuis tells me is v7 timeframe |
The next major release will make it a fatal error to use non-primitive values in function templates and object templates. Print a warning that includes the C and JS stack trace to tell people to upgrade their add-ons. The C stack trace is only printed on platforms that support it (the BSDs, OS X and Linux+glibc.) The warning can be disabled with the new `--nowarn_template_set` flag. Refs: nodejs#6216 PR-URL: nodejs#6277 Reviewed-By: James M Snell <jasnell@gmail.com>
V8 is going to disallow non-primitive values on v8::FunctionTemplate and v8::ObjectTemplate because those can't be shared across contexts. Fixes: nodejs#6216 PR-URL: nodejs#6228 Reviewed-By: Trevor Norris <trev.norris@gmail.com>
The next major release will make it a fatal error to use non-primitive values in function templates and object templates. Print a warning that includes the C and JS stack trace to tell people to upgrade their add-ons. The C stack trace is only printed on platforms that support it (the BSDs, OS X and Linux+glibc.) The warning can be disabled with the new `--nowarn_template_set` flag. Refs: nodejs#6216 PR-URL: nodejs#6277 Reviewed-By: James M Snell <jasnell@gmail.com>
The next major release will make it a fatal error to use non-primitive values in function templates and object templates. Print a warning that includes the C and JS stack trace to tell people to upgrade their add-ons. The C stack trace is only printed on platforms that support it (the BSDs, OS X and Linux+glibc.) The warning can be disabled with the new `--nowarn_template_set` flag. Refs: #6216 PR-URL: #6277 Reviewed-By: James M Snell <jasnell@gmail.com>
This was partially addressed by bumping NAN in #1496. nodejs/node#6216 https://codereview.chromium.org/1839983002/patch/1/10002 Fixes #1484
See [0] and [1]: starting with node.js v6, setting non-primitive values on FunctionTemplate and ObjectTemplate instances is discouraged; v7 will downright disallow it. Update the code base. [0] nodejs/node#6216 [1] nodejs/node#6228
The next major release will make it a fatal error to use non-primitive values in function templates and object templates. Print a warning that includes the C and JS stack trace to tell people to upgrade their add-ons. The C stack trace is only printed on platforms that support it (the BSDs, OS X and Linux+glibc.) The warning can be disabled with the new `--nowarn_template_set` flag. Refs: nodejs#6216 PR-URL: nodejs#6277 Reviewed-By: James M Snell <jasnell@gmail.com>
The next major release will make it a fatal error to use non-primitive values in function templates and object templates. Print a warning that includes the C and JS stack trace to tell people to upgrade their add-ons. The C stack trace is only printed on platforms that support it (the BSDs, OS X and Linux+glibc.) The warning can be disabled with the new `--nowarn_template_set` flag. Refs: nodejs#6216 PR-URL: nodejs#6277 Reviewed-By: James M Snell <jasnell@gmail.com>
The next major release will make it a fatal error to use non-primitive values in function templates and object templates. Print a warning that includes the C and JS stack trace to tell people to upgrade their add-ons. The C stack trace is only printed on platforms that support it (the BSDs, OS X and Linux+glibc.) The warning can be disabled with the new `--nowarn_template_set` flag. Refs: nodejs#6216 PR-URL: nodejs#6277 Reviewed-By: James M Snell <jasnell@gmail.com>
The next major release will make it a fatal error to use non-primitive values in function templates and object templates. Print a warning that includes the C and JS stack trace to tell people to upgrade their add-ons. The C stack trace is only printed on platforms that support it (the BSDs, OS X and Linux+glibc.) The warning can be disabled with the new `--nowarn_template_set` flag. Refs: nodejs#6216 PR-URL: nodejs#6277 Reviewed-By: James M Snell <jasnell@gmail.com>
According to nodejs/node#6216 only primitive values and V8 templates are allowed to set in a v8::ObjectTemplate.
This was partially addressed by bumping NAN in sass#1496. nodejs/node#6216 https://codereview.chromium.org/1839983002/patch/1/10002 Fixes sass#1484
This was partially addressed by bumping NAN in sass#1496. nodejs/node#6216 https://codereview.chromium.org/1839983002/patch/1/10002 Fixes sass#1484
See [0] and [1]: starting with node.js v6, setting non-primitive values on FunctionTemplate and ObjectTemplate instances is discouraged; v7 will downright disallow it. Update `Nan::SetPrototypeMethod()`. [0] nodejs/node#6216 [1] nodejs/node#6228
Steps to repro: apply https://codereview.chromium.org/1839983002/ to v8, attempt to run node.js
Templates are globally shared objects, if a template references a non-primitive value (i.e. anything but numbers, strings, or other templates), two things happen
To fix this, you can either introduce an accessor with the same name, and have the getter return the value (Template::SetAccessorProperty), or you can install a native data property. That will look like a regular value to JS, but under the hood, a getter is invoked (Template::SetNativeDataProperty)
/cc @ofrobots @nodejs/v8
The text was updated successfully, but these errors were encountered: