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

fix(std/node): Inline default objects to ensure correct prototype #8513

Merged
merged 4 commits into from
Nov 27, 2020

Conversation

guybedford
Copy link
Contributor

This is a follow-up to #8274 that instead inlines the explicit default export objects instead of using the import * as m; export default m wrapper technique.

The reason for this is that there are some methods that expect object prototype methods on Node.js builtins, for example:

const fs = require('fs');
if (fs.hasOwnProperty(prop))

which fail for the null prototype on module instances.

My hope previously is that it would make it easier to maintain the code, but in the end just keeping the named exports in sync with the default object for the Node.js shims is probably best and cuts down on the total number of files anyway.

As per the previous PR, I've separated the delete, move and edit file changes for easier review so that the last commit contains the substantial parts.

Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Sounds reasonable - LGTM - thanks @guybedford

@ry ry merged commit ff3c589 into denoland:master Nov 27, 2020
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 24, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Jan 31, 2021
caspervonb pushed a commit to caspervonb/deno_std that referenced this pull request Feb 1, 2021
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