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

wrong function name for getter/ setter (ES6) #7164

Description

@hoatle
  • Version: v6.2.1
  • Platform: Linux ee7f9120bc0a 3.13.0-86-generic lib: reintroduce v8 module #131-Ubuntu SMP Thu May 12 23:33:13 UTC 2016 x86_64 GNU/Linux
  • Subsystem:

sample code:

let obj = {
    get foo() {},
    set bar(value) {},
};

let getter = Object.getOwnPropertyDescriptor(obj, 'foo').get;
console.log(getter.name); //expect `get foo` but actual `foo`

let setter = Object.getOwnPropertyDescriptor(obj, 'bar').set;
console.log(setter.name); //expect `set bar` but actual `bar`

I tested this on Chrome and follow http://exploringjs.com/es6/ch_callables.html#_constructs-that-provide-names-for-functions (12.6.1.4 section), so I believe that it's a bug from NodeJS.

Activity

  1. vsemozhetbyt commented on Jun 5, 2016

    @vsemozhetbyt
    Contributor

    It's under --harmony_function_name flag in V8 5.0 (with this flag the output is the same as in the last Chrome Canary).

    See http://node.green/#function--name--property (accessor properties).

  2. targos commented on Jun 6, 2016

    @targos
    Member

    This issue will be fixed with #7016.

  3. bnoordhuis commented on Jun 6, 2016

    @bnoordhuis
    Member

    I'll close, not a node.js issue.

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

    invalidIssues and PRs that are invalid.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