aboutsummaryrefslogtreecommitdiff
path: root/tools/doc
diff options
context:
space:
mode:
authorNicola Del Gobbo <nicoladelgobbo@gmail.com>2017-10-06 09:49:05 -0700
committerGireesh Punathil <gpunathi@in.ibm.com>2017-10-11 14:52:03 +0530
commit8c6c06091888785f33da453c3e4177f6364f3c88 (patch)
tree7718c796359e4134e625396307cd68bc3f9d725f /tools/doc
parent2ddb2fad9435b1a4e7dec31983d93cab2149fc68 (diff)
downloadandroid-node-v8-8c6c06091888785f33da453c3e4177f6364f3c88.tar.gz
android-node-v8-8c6c06091888785f33da453c3e4177f6364f3c88.tar.bz2
android-node-v8-8c6c06091888785f33da453c3e4177f6364f3c88.zip
tools: replace string concatenation with template
Replace string concatenation in tools/doc/type-parser.js with template literals PR-URL: https://github.com/nodejs/node/pull/15827 Reviewed-By: Ryan Graham <r.m.graham@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'tools/doc')
-rw-r--r--tools/doc/type-parser.js19
1 files changed, 9 insertions, 10 deletions
diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js
index 4c2d29f2bf..fd2fc708f0 100644
--- a/tools/doc/type-parser.js
+++ b/tools/doc/type-parser.js
@@ -1,8 +1,8 @@
'use strict';
const nodeDocUrl = '';
const jsDocPrefix = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/';
-const jsDocUrl = jsDocPrefix + 'Reference/Global_Objects/';
-const jsPrimitiveUrl = jsDocPrefix + 'Data_structures';
+const jsDocUrl = `${jsDocPrefix}Reference/Global_Objects/`;
+const jsPrimitiveUrl = `${jsDocPrefix}Data_structures`;
const jsPrimitives = {
'boolean': 'Boolean',
'integer': 'Number', // not a primitive, used for clarification
@@ -22,10 +22,10 @@ const jsGlobalTypes = [
'AsyncFunction', 'SharedArrayBuffer'
];
const typeMap = {
- 'Iterable': jsDocPrefix +
- 'Reference/Iteration_protocols#The_iterable_protocol',
- 'Iterator': jsDocPrefix +
- 'Reference/Iteration_protocols#The_iterator_protocol',
+ 'Iterable':
+ `${jsDocPrefix}Reference/Iteration_protocols#The_iterable_protocol`,
+ 'Iterator':
+ `${jsDocPrefix}Reference/Iteration_protocols#The_iterator_protocol`,
'Buffer': 'buffer.html#buffer_class_buffer',
@@ -87,11 +87,10 @@ module.exports = {
}
if (typeUrl) {
- typeLinks.push('<a href="' + typeUrl + '" class="type">&lt;' +
- typeTextFull + '&gt;</a>');
+ typeLinks.push(`
+ <a href="${typeUrl}" class="type">&lt;${typeTextFull}&gt;</a>`);
} else {
- typeLinks.push('<span class="type">&lt;' + typeTextFull +
- '&gt;</span>');
+ typeLinks.push(`<span class="type">&lt;${typeTextFull}&gt;</span>`);
}
}
});