-
Notifications
You must be signed in to change notification settings - Fork 2k
Add support for ES2015 classes and extension #3375
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
Conversation
Fixes #2520 Supported Use Cases: 1. `class MyElement` 2. `class MyElement extends Polymer.Element` 3. `class MyElement extends Polymer.Extend('input')` 4. `class MyElement extends OtherPolymerElement` 5. `class MyElement extends Polymer.Extend('other-polymer-element')`
Drop chained prototype list, it is unnecessary Add test for 2nd-order extension of input element
* Utility function for extending native elements and Polymer elements with | ||
* ES2015 class syntax. | ||
* | ||
* `Polymer.Extend()` will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incomplete comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name seems kinda general. Maybe ElementConstructor
or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of the long function name
class XFoo extends Polymer.ElementConstructor('other-element')
Make __extendsNativeElement hold the native element tag name, if any prototype extends a native element, it will have __extendsNativeElement set on it Use constructors "the right way" in the ES2015 test
LGTM |
Add support for ES2015 classes and extension
Supported Use Cases:
class MyElement
class MyElement extends Polymer.Element
class MyElement extends Polymer.Extend('input')
class MyElement extends OtherPolymerElement
class MyElement extends Polymer.Extend('other-polymer-element')
Fixes #2520