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

util: add optional thisArg argument to promisify #13440

Closed
wants to merge 1 commit into from
Closed

util: add optional thisArg argument to promisify #13440

wants to merge 1 commit into from

Conversation

seishun
Copy link
Contributor

@seishun seishun commented Jun 3, 2017

Fixes #13338.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

util

@nodejs-github-bot nodejs-github-bot added the util Issues and PRs related to the built-in util module. label Jun 3, 2017
@bnoordhuis
Copy link
Member

Seems kind of pointless, to be honest. f.bind(obj) does the same thing and with similar performance.

@seishun
Copy link
Contributor Author

seishun commented Jun 3, 2017

Seems kind of pointless, to be honest. f.bind(obj) does the same thing and with similar performance.

I tend to agree. Let's see what others think.

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Jun 3, 2017

Refs: http://2ality.com/2017/05/util-promisify.html#comment-3337071350

1

@addaleax
Copy link
Member

addaleax commented Jun 3, 2017

This should at least also take care of the case that orig[kCustomPromisifiedSymbol] is set (in that case, it’s probably just best to return fn.bind(thisArg)).

@vsemozhetbyt vsemozhetbyt added the promises Issues and PRs related to ECMAScript promises. label Jun 3, 2017
@seishun
Copy link
Contributor Author

seishun commented Jun 9, 2017

I guess we don't want this.

@seishun seishun closed this Jun 9, 2017
@seishun seishun deleted the promisify-ctx branch June 9, 2017 18:36
@sclausen
Copy link

I ran into the same issue @vsemozhetbyt referenced. The errors will occur in the library to promisify and are misleading.
At least a hint in the docs would've been great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
promises Issues and PRs related to ECMAScript promises. util Issues and PRs related to the built-in util module.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add context option to utils.promisify() for method binding
6 participants