Skip to content

tools: replace string concetation with template literals - #16801

Closed
PatrickHeneise wants to merge 1 commit into
nodejs:masterfrom
PatrickHeneise:doc-string-concat
Closed

tools: replace string concetation with template literals#16801
PatrickHeneise wants to merge 1 commit into
nodejs:masterfrom
PatrickHeneise:doc-string-concat

Conversation

@PatrickHeneise

Copy link
Copy Markdown

Replace string concatenation in tools/doc/html.js with template literals.

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-botnodejs-github-bot added doc Issues and PRs related to the documentations. tools Issues and PRs related to the tools directory. labels Nov 6, 2017
@Trott

Trott commented Nov 6, 2017

Copy link
Copy Markdown
Member

Comment threadtools/doc/html.js
text = text.replace(/^([^a-z])/, '_$1');
if (idCounters.hasOwnProperty(text)) {
text += '_' + (++idCounters[text]);
text += `_${(++idCounters[text])}`;

@vsemozhetbytvsemozhetbytNov 6, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

A nit (this can be done by whoever will land the PR): parentheses seem redundant now, this can simply be:

text+=`_${++idCounters[text]}`;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry, I missed this comment while landing. Doesn't seem worth force-pushing or doing an additional commit at this point to me, although if someone opens a PR for it, sure, I'm OK with that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Trott pushed a commit to Trott/io.js that referenced this pull request Nov 6, 2017
Replace string concatenation in tools/doc/html.js with template
literals.
PR-URL: nodejs#16801
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott

Trott commented Nov 6, 2017

Copy link
Copy Markdown
Member

Landed in 94fb298.

Thanks for the contribution! 🎉

@TrottTrott closed this Nov 6, 2017
@TrottTrott added the code-and-learn Issues related to the Code-and-Learn events and PRs submitted during the events. label Nov 6, 2017
cjihrig pushed a commit to cjihrig/node that referenced this pull request Nov 6, 2017
Replace string concatenation in tools/doc/html.js with template
literals.
PR-URL: nodejs#16801
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@cjihrigcjihrig mentioned this pull request Nov 6, 2017
Trott pushed a commit to Trott/io.js that referenced this pull request Nov 6, 2017
PR-URL: nodejs#16845
Ref: nodejs#16801 (comment)
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
cjihrig pushed a commit to cjihrig/node that referenced this pull request Nov 7, 2017
PR-URL: nodejs#16845
Ref: nodejs#16801 (comment)
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
Replace string concatenation in tools/doc/html.js with template
literals.
PR-URL: #16801
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
Replace string concatenation in tools/doc/html.js with template
literals.
PR-URL: #16801
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
PR-URL: #16845
Ref: #16801 (comment)
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 16, 2017
PR-URL: #16845
Ref: #16801 (comment)
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@MylesBorinsMylesBorins mentioned this pull request Nov 21, 2017
@gibfahngibfahn mentioned this pull request Nov 21, 2017
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
Replace string concatenation in tools/doc/html.js with template
literals.
PR-URL: #16801
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 21, 2017
PR-URL: #16845
Ref: #16801 (comment)
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
Replace string concatenation in tools/doc/html.js with template
literals.
PR-URL: #16801
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this pull request Nov 28, 2017
PR-URL: #16845
Ref: #16801 (comment)
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-and-learnIssues related to the Code-and-Learn events and PRs submitted during the events.docIssues and PRs related to the documentations.toolsIssues and PRs related to the tools directory.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@PatrickHeneise@Trott@cjihrig@gireeshpunathil@vsemozhetbyt@MylesBorins@nodejs-github-bot