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

Do not allow arrow functions as the "factory" function for registerServiceDorDoc #26776

Merged
merged 3 commits into from
Feb 13, 2020

Conversation

erwinmombay
Copy link
Member

in the module build this errors out because arrow functions are not newable

@amp-owners-bot
Copy link

Hey @jridgewell, these files were changed:

  • build-system/eslint-rules/no-arrow-on-register-functions.js

Copy link
Contributor

@kevinkimball kevinkimball left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@rsimha rsimha left a comment

Choose a reason for hiding this comment

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

Hang on... I'm summoning my inner @jridgewell as I read this...

Okay, LGTM.

@erwinmombay
Copy link
Member Author

i'm going to file a bug against closure compiler as well, as Arrow Functions should not be allowed to be passed into a parameter that is new'd

Copy link
Contributor

@kristoferbaxter kristoferbaxter left a comment

Choose a reason for hiding this comment

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

Thanks for addressing so quickly.

@erwinmombay erwinmombay merged commit 09d4985 into ampproject:master Feb 13, 2020
erwinmombay added a commit that referenced this pull request Feb 13, 2020
…rviceDorDoc (#26776)

* don't allow registration of arrow function as factory

* apply lint fixes

* Do not allow arrow functions as the "factory" function
erwinmombay added a commit that referenced this pull request Feb 18, 2020
…rviceDorDoc (#26776)

* don't allow registration of arrow function as factory

* apply lint fixes

* Do not allow arrow functions as the "factory" function
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.

None yet

6 participants