Skip to content

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

Merged
merged 9 commits into from
Feb 9, 2016
Merged

Conversation

dfreedm
Copy link
Member

@dfreedm dfreedm commented Feb 4, 2016

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')

Fixes #2520

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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incomplete comment

Copy link
Contributor

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?

Copy link
Member Author

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
@dfreedm dfreedm added the p1 label Feb 8, 2016
@dfreedm dfreedm self-assigned this Feb 8, 2016
@sorvell
Copy link
Contributor

sorvell commented Feb 9, 2016

LGTM

sorvell pushed a commit that referenced this pull request Feb 9, 2016
Add support for ES2015 classes and extension
@sorvell sorvell merged commit 3ba9427 into extends Feb 9, 2016
@sorvell sorvell deleted the es2015-class-syntax branch February 9, 2016 02:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants