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

doc: change ambiguous phrase in api.md #410

Merged
merged 1 commit into from
Aug 20, 2017

Conversation

vsemozhetbyt
Copy link
Contributor

I was a bit puzzled about what was passed in and where, but I am not a native speaker and may not be reliable here.

Please, close if the wording was OK.

@aslushnikov
Copy link
Contributor

@ebidel Eric, what would you say? :)

docs/api.md Outdated
@@ -1129,7 +1129,7 @@ The `elementHandle.dispose` method stops referencing the element handle.
- returns: <[Promise]<[Serializable]>> Promise which resolves to function return value

If the function, passed to the `elementHandle.evaluate`, returns a [Promise], then `elementHandle.evaluate` would wait for the promise to resolve and return it's value.
The function will be passed in the element ifself as a first argument.
The element ifself will be passed in the function as a first argument.
Copy link
Contributor

@ebidel ebidel Aug 20, 2017

Choose a reason for hiding this comment

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

I think it was intended to read as: "The element gets passed to pageFunction as a first argument."

However, is this true? Doesn't pageFunction get passed args, not the element handle? Maybe leftover from a previous time?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, this is still true: the element itself is passed as a first argument, followed by all the arguments. (note: this is elementHandle.evaluate, not page.evaluate)

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah ok. Then how about: "The element will be passed as the first argument to pageFunction, followed by any args."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@aslushnikov aslushnikov merged commit 281db8f into puppeteer:master Aug 20, 2017
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