-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛: Reject layoutCallback promise when throw #15410
Conversation
src/custom-element.js
Outdated
this.classList.add('i-amphtml-layout'); | ||
|
||
let promise; | ||
try { |
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.
you can use:
Line 70 in e21f78c
export function tryResolve(fn) { |
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.
done
47e37f9
to
3e49c31
Compare
cc @jridgewell |
3e49c31
to
a98c056
Compare
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.
👏
Throwing error synchronously breaks
#layoutCallback
, because it won't return a promise. And the handler for promise reject will never run.