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

Action handler subsystem #1261

Merged
merged 1 commit into from
Dec 29, 2015
Merged

Action handler subsystem #1261

merged 1 commit into from
Dec 29, 2015

Conversation

dvoytenko
Copy link
Contributor

No description provided.

@@ -121,6 +126,39 @@ export class ActionService {
}

/**
* Installs action handler for the specified element.
* @param {!Element} target
* @param {function(!ActionInvocation)} handler
Copy link
Member

Choose a reason for hiding this comment

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

do we need a bang on function? (cant remember if function was implicitly not nullable, i know Function definitely is nullable by default)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, lower-case function is non-nullable.

@erwinmombay
Copy link
Member

@dvoytenko LGTM

*/
installActionHandler(target, handler) {
const debugid = target.tagName + '#' + target.id;
assert(this.isAmpElement_(target), 'AMP element is expected: %s', debugid);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we pass the target so the error has associatedElement?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not in this case. This is a non-authoring visible error. Unfortunately, assert and associate elements are a bit abused. I believe we are tracking it somewhere in one of the issues. Right, @erwinmombay ?

Copy link
Member

Choose a reason for hiding this comment

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

@dvoytenko correct, tracked in #1031 will continue work on it soon.

@erwinmombay
Copy link
Member

deferring to @jridgewell for final LGTM as he has some concerns.

@jridgewell
Copy link
Contributor

:shipit:

dvoytenko added a commit that referenced this pull request Dec 29, 2015
@dvoytenko dvoytenko merged commit f3edeb2 into ampproject:master Dec 29, 2015
@dvoytenko dvoytenko deleted the access2 branch December 29, 2015 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants