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

Update module.js #11032

Closed
wants to merge 1 commit into from
Closed

Update module.js #11032

wants to merge 1 commit into from

Conversation

earforth
Copy link

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)

@nodejs-github-bot nodejs-github-bot added module Issues and PRs related to the module subsystem. lts-watch-v6.x labels Jan 27, 2017
@mscdex
Copy link
Contributor

mscdex commented Jan 27, 2017

I'm not convinced we should start removing try-catch/try-finally helper functions just yet. node v7 was the first branch to have a version of V8 that allowed for optimization of functions containing such statements and even then the functions containing these statements are currently not inlineable.

@earforth
Copy link
Author

I'm not removing try-catch/try-finally , I just adjust the sequence to delete the "threw"

@earforth
Copy link
Author

just like this
try {
module.load(filename);
Module._cache[filename] = module;
} finally {
}

return module.exports;

@mscdex
Copy link
Contributor

mscdex commented Jan 27, 2017

You're removing the helper function (tryModuleLoad()) which helps isolate the effects of having try-catch/try-finally in a function.

@earforth
Copy link
Author

In v4.x, there is no function tryModuleLoad

@mscdex
Copy link
Contributor

mscdex commented Jan 27, 2017

The reason it's not in v4.x is because that particular change didn't get backported (due to waiting for the changes to sit for awhile in non-LTS branches). It does exist in v6.x, v7.x, and master however.

@bnoordhuis
Copy link
Member

@earforth What is the motivation for this change? We don't usually accept aesthetic-only changes.

Copy link
Member

@jasnell jasnell left a comment

Choose a reason for hiding this comment

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

I think I'm -1 on this one. The code here is very sensitive to breakage and this does not appear to deliver enough benefit.

@earforth earforth closed this Jan 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module Issues and PRs related to the module subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants