summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authoryorkie <yorkiefixer@gmail.com>2016-09-23 13:36:22 +0800
committeryorkie <yorkiefixer@gmail.com>2016-09-26 22:26:22 +0800
commiteaa08062f317a439ec655a231cee948ead8ae7dd (patch)
tree8140cabef139ba286a389a330e8ec9927a6fa15f /tools
parentc9b59e8387b08dab20936f32d2b290804718f688 (diff)
downloadandroid-node-v8-eaa08062f317a439ec655a231cee948ead8ae7dd.tar.gz
android-node-v8-eaa08062f317a439ec655a231cee948ead8ae7dd.tar.bz2
android-node-v8-eaa08062f317a439ec655a231cee948ead8ae7dd.zip
doc,tool: add ref to Integer
We documented most types as Integer, but we don't have link for that. PR-URL: https://github.com/nodejs/node/pull/8740 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'tools')
-rw-r--r--tools/doc/type-parser.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/doc/type-parser.js b/tools/doc/type-parser.js
index 652b87add5..405d3a869d 100644
--- a/tools/doc/type-parser.js
+++ b/tools/doc/type-parser.js
@@ -4,11 +4,16 @@ const jsDocUrl = 'https://developer.mozilla.org/en-US/docs/Web/JavaScript/' +
'Reference/Global_Objects/';
const jsPrimitiveUrl = 'https://developer.mozilla.org/en-US/docs/Web/' +
'JavaScript/Data_structures';
-const jsPrimitives = [
- 'Number', 'String', 'Boolean', 'Null', 'Symbol'
-];
+const jsPrimitives = {
+ 'Integer': 'Number', // this is for extending
+ 'Number': 'Number',
+ 'String': 'String',
+ 'Boolean': 'Boolean',
+ 'Null': 'Null',
+ 'Symbol': 'Symbol'
+};
const jsGlobalTypes = [
- 'Error', 'Object', 'Function', 'Array', 'Uint8Array',
+ 'Error', 'Object', 'Function', 'Array', 'TypedArray', 'Uint8Array',
'Uint16Array', 'Uint32Array', 'Int8Array', 'Int16Array', 'Int32Array',
'Uint8ClampedArray', 'Float32Array', 'Float64Array', 'Date', 'RegExp',
'ArrayBuffer', 'DataView', 'Promise', 'EvalError', 'RangeError',
@@ -38,8 +43,9 @@ module.exports = {
typeText = typeText.trim();
if (typeText) {
let typeUrl = null;
- if (jsPrimitives.indexOf(typeText) !== -1) {
- typeUrl = jsPrimitiveUrl + '#' + typeText + '_type';
+ const primitive = jsPrimitives[typeText];
+ if (primitive !== undefined) {
+ typeUrl = `${jsPrimitiveUrl}#${primitive}_type`;
} else if (jsGlobalTypes.indexOf(typeText) !== -1) {
typeUrl = jsDocUrl + typeText;
} else if (typeMap[typeText]) {