Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Multiple levels of Class inheritance when extending State causes static hint configuration issues #287

@robframpton

Description

@robframpton

Found when looking into test failures for metal-drag-drop: deprecate/metal-drag-drop#8 (comment)

When creating a new instance of class that extends from State, a flag is set on the constructor to indicate that has configured the state 2c50c73#diff-0aee89f1c625f93fd4bfd8a5e3bbfb99R275.

However, when another class uses this class as a parent, that flag will already be set, and the configuration is not set up properly.

class Parent extends State {
}

class Child extends Parent {
}

Child.STATE = {
  foo: {
    setter: function(val) {
      console.log('this is never called');
    }
  }
};

// Parent must be invoked first to reproduce
new Parent({});

const child = new Child({
  foo: 'foo'
});

child.foo !== 'foo';

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions