Skip to content

small fix to fake function prototype#6527

Merged
zhouyx merged 4 commits intoampproject:masterfrom
zhouyx:prototype-fix
Dec 7, 2016
Merged

small fix to fake function prototype#6527
zhouyx merged 4 commits intoampproject:masterfrom
zhouyx:prototype-fix

Conversation

@zhouyx
Copy link
Copy Markdown
Contributor

@zhouyx zhouyx commented Dec 7, 2016

No description provided.

@zhouyx zhouyx changed the title Prototype fix small fix to fake function prototype Dec 7, 2016
// Send request to received records.
if (window.IntersectionObserver && window.IntersectionObserver.prototype) {
if (window.IntersectionObserver &&
Object.keys(window.IntersectionObserver.prototype).length) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We can check for IntersectionObserver.prototype.observe instead. Can we add a comment why the test is necessary, too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

window.IntersectionObserver.prototype.observe) {
// use native IntersectionObserver if exist. NOTE: add the check for
// prototype.observer for test reason to force using polyfill by fake
// the prototype.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you check the grammar?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

😢 what about now?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Much better, thanks!

@zhouyx zhouyx merged commit 5842b29 into ampproject:master Dec 7, 2016
@zhouyx zhouyx deleted the prototype-fix branch December 7, 2016 21:40
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
* small fix

* remove comment

* address comment

* grammar
Lith pushed a commit to Lith/amphtml that referenced this pull request Dec 22, 2016
* small fix

* remove comment

* address comment

* grammar
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.

2 participants