| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Refactor the internal NativeModule class to a JS class and add more documentation about its properties.
Sorry, something went wrong.
| this.canBeRequiredByUsers = !id.startsWith('internal/'); | ||
|
|
||
| // The CJS exports object of the module. | ||
| this.exports = {}; |
There was a problem hiding this comment.
Wouldn't a public (or maybe private) field declaration be preferable?
class NativeModule {
exports = {};
#loaded = false;
#loading = false;
module = undefined;
exportKeys = undefined;
}I personally find it more readable than a declaration in the constructor, but that might just be me.
Sorry, something went wrong.
There was a problem hiding this comment.
i don't mind if private fields are used but i think we should keep field initialization in one spot (in this case, the constructor, since it assigns from arguments).
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
Refactor the internal NativeModule class to a JS class and add more documentation about its properties. PR-URL: #30856 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Rich Trott <rtrott@gmail.com>
Refactor the internal NativeModule class to a JS class and add more documentation about its properties. PR-URL: #30856 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Rich Trott <rtrott@gmail.com>
Refactor the internal NativeModule class to a JS class and add more documentation about its properties. PR-URL: #30856 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Rich Trott <rtrott@gmail.com>
Refactor the internal NativeModule class to a JS class and add more documentation about its properties. PR-URL: #30856 Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Rich Trott <rtrott@gmail.com>
| Back | FazBrowse Home | New Git URL |
Refactor the internal NativeModule class to a JS class and add
more documentation about its properties.
Tip: https://github.com/nodejs/node/pull/30856/files?w=1 is easier to review
Checklist