Skip to content
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

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

Closed
robframpton opened this issue Oct 30, 2017 · 1 comment
Labels
Milestone

Comments

@robframpton
Copy link

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';
robframpton pushed a commit to robframpton/metal.js that referenced this issue Oct 31, 2017
@robframpton robframpton added this to the 2.14.0 milestone Oct 31, 2017
@jbalsas jbalsas added the bug label Nov 1, 2017
@jbalsas
Copy link
Contributor

jbalsas commented Nov 2, 2017

This was merged to develop and scheduled for 2.14.0

@jbalsas jbalsas closed this as completed Nov 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants