镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Calls to v8::Template::Set must not pass in non-primitive values #6216

Description

@jeisinger

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

  • the non-primitive value will never day and so will the context it was created in, or anything referenced from that context
  • all contexts the template is instantiated in can access each other via the shared non-primitive value

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

Activity

  1. added
    c++Issues and PRs that require attention from people who are familiar with C++.
    v8 engineIssues and PRs related to the V8 dependency.
    on Apr 15, 2016
  2. ofrobots commented on Apr 15, 2016

    @ofrobots
    Contributor

    I can investigate this next week. If anyone else is interested in investigating, feel free (but let me know).

  3. bnoordhuis commented on Apr 15, 2016

    @bnoordhuis
    Member

    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.

  4. jeisinger commented on Apr 15, 2016

    @jeisinger
    ContributorAuthor

    Yeah, if only node had a proper API ...

  5. added this to the 7.0.0 milestone on Apr 15, 2016
  6. bnoordhuis commented on Apr 15, 2016

    @bnoordhuis
    Member
  7. Fishrock123 commented on Apr 19, 2016

    @Fishrock123
    Contributor

    When is the patch that causes this landing? Not in v6 right?

  8. removed this from the 7.0.0 milestone on Apr 19, 2016
  9. jeisinger commented on Apr 19, 2016

    @jeisinger
    ContributorAuthor

    It's part of v8 5.2 which @bnoordhuis tells me is v7 timeframe

  10. 22 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions