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

lib: restate the code to use primordials #36561

Closed
wants to merge 1 commit into from

Conversation

PoojaDurgad
Copy link
Contributor

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

@nodejs-github-bot nodejs-github-bot added the tools Issues and PRs related to the tools directory. label Dec 18, 2020
@PoojaDurgad
Copy link
Contributor Author

@aduh95
Copy link
Contributor

aduh95 commented Dec 18, 2020

I tried doing that in #36527 (fe72118 and b30bb91), but it seems this file cannot use primordials.

@PoojaDurgad
Copy link
Contributor Author

@aduh95 - yeah, looks like this file cannot use primordials. but why ? is there any other files which cannot use primordials?

@aduh95
Copy link
Contributor

aduh95 commented Dec 18, 2020

Not sure, but I think this is a one-of.

@Trott
Copy link
Member

Trott commented Dec 21, 2020

Feel free to continue discussion or even re-open if you think appropriate, but I'm going to close this since it doesn't seem like it's going to land.

@Trott Trott closed this Dec 21, 2020
filtered = filtered.split('\n');
return out.replace(FUNC_RE, (all, prefix, postfix) => {
filtered = StringPrototypeSplit(filtered, '\n');
return StringPrototypeReplace(out, FUNC_RE, (all, prefix, postfix) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Note that calling StringPrototypeReplace on a RegExp is unsafe, as it calls RegExp.prototype[Symbol.replace].


This should instead use:

Suggested change
return StringPrototypeReplace(out, FUNC_RE, (all, prefix, postfix) => {
return RegExpPrototypeSymbolReplace(FUNC_RE, out, (all, prefix, postfix) => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants