Skip to content

Super in object method key has wrong HomeObject #7682

@nicolo-ribaudo

Description

@nicolo-ribaudo

Choose one: is this a bug report or feature request?

Input Code

var get_super_foo, get_super_bar;

var outer = {
  method() {
    var inner = {
      [(() => { get_super_foo = () => super.foo; return "fn" })()]() {},
      [(() => { get_super_bar = () => super.bar; return "fn" })()]: 0,
      __proto__: { foo: "inner_foo", bar: "inner_bar" }
    };
    return inner;
  },
  __proto__: { foo: "outer_foo", bar: "outer_bar" }
}

outer.method();

console.log(get_super_foo() + " " + get_super_bar());

Babel/Babylon Configuration (.babelrc, package.json, cli command)

es2015 preset

Expected Behavior

outer_foo outer_bar

Current Behavior

inner_foo outer_bar

Your Environment

software version(s)
Babel master (7.0.0-beta.44)
Babylon
node
npm
Operating System

Metadata

Metadata

Assignees

No one assigned

    Labels

    PR: Spec Compliance 👓A type of pull request used for our changelog categoriesoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions