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

shim.js: duplicate code? #3

Closed
rauschma opened this issue May 30, 2017 · 3 comments
Closed

shim.js: duplicate code? #3

rauschma opened this issue May 30, 2017 · 3 comments

Comments

@rauschma
Copy link

Delete the first of the following two lines?

util.promisify = polyfill;
Object.defineProperty(util, 'promisify', { value: polyfill });
@ljharb
Copy link
Owner

ljharb commented May 30, 2017

I intentionally did both - the former will only fail if it's non-writable, and there are some engines where you need normal assignment to be able to override things.

However, as I complete #1, I'll probably clean this up if I find it to be unnecessary.

@ljharb ljharb closed this as completed May 30, 2017
@ljharb ljharb reopened this May 30, 2017
@rauschma
Copy link
Author

Interesting, thanks for the explanation! If the former fails, you get an exception, though (strict mode). Also intended?

Maybe add a comment so that people know that the duplication is intentional?

@ljharb
Copy link
Owner

ljharb commented May 30, 2017

ha, that's a good point that I explicitly put it in strict mode :-p

Yeah, I'll just remove this.

@ljharb ljharb closed this as completed in 84bccf3 May 30, 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

No branches or pull requests

2 participants