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

bootstrap_node: remove side effects on RegExp #19138

Closed
wants to merge 1 commit into from

Conversation

TimothyGu
Copy link
Member

Fixes: #18930

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

bootstrap_node

@TimothyGu TimothyGu added the lib / src Issues and PRs related to general changes in the lib or src directory. label Mar 4, 2018
@nodejs-github-bot nodejs-github-bot added the process Issues and PRs related to the process subsystem. label Mar 4, 2018
@TimothyGu
Copy link
Member Author

To clarify why I took this approach instead of running the regexes in a new context: Contexts are really memory-expensive, and I'd rather not have to wait for the GC to activate for something we will use only once. It would also complicate the effort to create V8 snapshots for Node.js core (see #17058).

@Trott
Copy link
Member

Trott commented Mar 4, 2018

Micro-nit: I'd prefer a more descriptive name for the test and/or a bit more comment explaining what the test is testing for. I'm fine with this landing without these concerns addressed. Just my own opinion/suggestion. Take it or leave it.

@devsnek
Copy link
Member

devsnek commented Mar 5, 2018

this seems like a band-aid, can't we just preprocess the gypi file at build time?

@TimothyGu
Copy link
Member Author

can't we just preprocess the gypi file at build time?

Yes, but I personally did not want to get into the build system 😄

Feel free to propose a better approach with a new pull request.

// convert the Python syntax to proper JSON
// We cannot use a regex due to side effects on static properties of RegExp
// (e.g., RegExp.$_).
let out = '';
Copy link
Member

Choose a reason for hiding this comment

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

Nit: maybe a more descriptive name than "out"?

@devsnek
Copy link
Member

devsnek commented Mar 6, 2018

the test will fail on windows for the reasons seen in #19140 (comment)

@TimothyGu
Copy link
Member Author

Closing, as #19140 has been landed.

@TimothyGu TimothyGu closed this Mar 23, 2018
@TimothyGu TimothyGu deleted the bootstrap-regexp branch March 23, 2018 00:08
@devsnek
Copy link
Member

devsnek commented Mar 23, 2018

something to note, 19140 did not fix the fact that the regexp object is still poisoned on windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lib / src Issues and PRs related to general changes in the lib or src directory. process Issues and PRs related to the process subsystem.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

lib: bootstrap should not have RegExp side effects
5 participants