Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
6bc49f0
test: http2 errors on req.close()
trivikr Feb 18, 2018
cc68bc2
test: add more asserts to `test-internal-errors`
refack Jun 19, 2017
44b12c1
test: fix common.expectsError
refack Jun 14, 2017
ca97be5
test: fix wrong error classes passed in as type
BridgeAR Dec 11, 2017
4caf536
test: http2 stream.respond() error checks
trivikr Feb 19, 2018
441175c
http2: refer to stream errors by name
addaleax Feb 23, 2018
21e69d1
test: fix test-tty-get-color-depth
bzoz Jan 31, 2018
cae9ff2
src: fix upcoming V8 deprecation warnings
Mar 20, 2018
ee4390a
repl: fix tab completion of inspector module
targos Mar 21, 2018
99e3c77
url: refactor "escapeParam" function to make it common
daynin Mar 1, 2018
fdc51a1
url: remove redundant function
daynin Mar 1, 2018
8a8b43e
fs,net: emit 'ready' for fs streams and sockets
sameer-coder Mar 17, 2018
dac5f67
http: support server options on createServer
wesleytodd Mar 19, 2018
7b850a7
http2: destroy() stream, upon errnoException
Mar 16, 2018
d3d1ee7
lib: add internal check macros
devsnek Mar 2, 2018
a45f3f8
lib: document nextTick queue internals
addaleax Mar 20, 2018
1a38b9b
src: remove unused 'ares.h' include from env.h
addaleax Mar 23, 2018
6c46681
src: name all builtin init functions Initialize
danbev Mar 23, 2018
94a10ba
n-api: bump version of n-api supported
mhdawson Mar 20, 2018
274eff5
test: update link according to NIST bibliography
tniessen Mar 25, 2018
7555dee
doc: improve zero-fill-buffers text
Trott Mar 26, 2018
b0a3a44
n-api: ensure in-module exceptions are propagated
Mar 22, 2018
2ea7f90
doc: fix grammar error in process.md
kenjiO Mar 27, 2018
0daa063
test: amplify and optimize doctool/test-make-doc
vsemozhetbyt Mar 24, 2018
2c5d53f
tools: fix nits in tools/doc/type-parser.js
vsemozhetbyt Mar 26, 2018
97a92c4
deps: turn in std::string for ICU
srl295 Mar 5, 2018
0786161
doc: guard against md list parsing edge case
vsemozhetbyt Mar 28, 2018
278e8af
test: rename tests with descriptive filenames
ryzokuken Mar 22, 2018
889a3b4
lib: fix a typo in lib/timers "read through"
adispring Mar 29, 2018
2f09ee7
test: refactor test-http-expect-continue
Trott Mar 27, 2018
806bc0d
test: fix assert.throws error in test-http-parser
Trott Mar 27, 2018
677b613
test: fix typo in test-tls-cnnic-whitelist
danbev Mar 28, 2018
a89ba21
test: refactor test-net-dns-error
lpinca Mar 27, 2018
7ae2ca4
test: removed default message from assert.strictEqual
jaspal-yupana Mar 28, 2018
94b28aa
test: use createReadStream instead of ReadStream
danbev Mar 27, 2018
9f20534
doc: shorten character encoding introduction
Trott Mar 28, 2018
01e3190
src: general C++ cleanup in node_url.cc
addaleax Mar 25, 2018
140611b
tools: fix comment nits in tools/doc/*.js files
vsemozhetbyt Mar 30, 2018
7043e95
tools: dry utility function in tools/doc/json.js
vsemozhetbyt Mar 30, 2018
0b27416
test: make test-http-expect-continue more strict
Trott Mar 29, 2018
75d23ab
src: fix warnings in aliased_buffer
kfarnung Mar 24, 2018
c8fa8f1
doc: remove ES6/ECMAScript 2015 from buffer.md
Trott Mar 29, 2018
ff7f28c
test: remove 3rd argument from assert.strictEqual
Axxxx0n Mar 30, 2018
90c8546
test: rename regression tests more expressively
ryzokuken Mar 29, 2018
44361bd
doc: fix quotes mistypes in inline code blocks
ChALkeR Mar 31, 2018
bb32bc8
doc: fix links in vm.md
vsemozhetbyt Apr 1, 2018
859b719
module: skip preserveSymlinks for main
guybedford Mar 16, 2018
239a036
tools: remove src dir from JS editorconfig rule
tniessen Mar 21, 2018
b80d169
tools: apply editorconfig rules to tools also
tniessen Mar 21, 2018
54b84f3
buffer: remove "new" from deprecation message
Trott Mar 30, 2018
d111037
doc: favor utf16le over ucs2 in buffer.md
Trott Mar 30, 2018
3a3ae01
doc: do not identify string as "JavaScript string"
Trott Mar 30, 2018
c5469bb
doc: remove "if provided" for optional arguments
Trott Mar 30, 2018
0bcad33
inspector: report client-visible host and port
Mar 6, 2018
e44b777
test: fix flaky test-cluster-send-handle-twice
Trott Mar 30, 2018
152a86c
lib: make isStackOverflowError() engine-agnostic
Mar 30, 2018
5149e18
doc: deprecation clarifications
jasnell Mar 21, 2018
1aaad92
doc: fix lint nits in COLLABORATOR_GUIDE.md
vsemozhetbyt Apr 2, 2018
58f61db
deps: ICU 61.1 bump
srl295 Mar 26, 2018
e0c7d78
lint: change require-buffer rule message
devsnek Mar 30, 2018
c1b83fc
doc: update to adding listens on SIGUSR1
willhayslett Mar 30, 2018
a0a5873
n-api: back up env before finalize
Apr 1, 2018
53d7fbb
tools: don’t emit illegal utf-8 from icutrim/iculslocs
srl295 Apr 2, 2018
42671f2
doc: add mafintosh to collaborators
mafintosh Apr 3, 2018
e1f44a6
http: fix `request` when `setHost` is `true`
XadillaX Mar 21, 2018
46569d6
test: remove third argument from call to assert.strictEqual()
ForrestWeiswolf Mar 27, 2018
f379167
test: improve assert message
q3e Mar 27, 2018
4df3377
test: update test to comply with lint rule
Trott Apr 4, 2018
041f6cd
doc: improve Buffer.allocUnsafeSlow() and related
Trott Apr 2, 2018
92e9ed0
test: test process.setuid for bad argument types
dsinecos Mar 30, 2018
0127712
build: introduce make jstest
joyeecheung Mar 13, 2018
0bd78dc
buffer: use v8::TypedArray::kMaxLength as buffer::kMaxLength
joyeecheung Apr 2, 2018
ae86adc
doc: fix various nits
vsemozhetbyt Apr 2, 2018
5e90fc6
fs: use fs.access in fs.exists
bzoz Mar 28, 2018
ff7a116
src: move internal loaders out of bootstrap_node.js
joyeecheung Mar 3, 2018
ebdcf91
src: put bootstrappers in lib/internal/bootstrap/
joyeecheung Mar 6, 2018
83ebaf0
test: remove NODE_DEBUG in global module loading test
joyeecheung Mar 14, 2018
45c477c
lib: restructure cjs and esm loaders
joyeecheung Mar 6, 2018
8e44011
lib: add back lib/module.js redirection
joyeecheung Mar 14, 2018
2bdf3ca
http2: callback valid check before closing request
trivikr Feb 28, 2018
11c8db4
2018-04-04, Version 9.11.0 (Current)
targos Apr 4, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
tools: dry utility function in tools/doc/json.js
Also, move a declaration of unrelated variable
closer to its only context.

PR-URL: #19692
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
vsemozhetbyt authored and targos committed Apr 2, 2018
commit 7043e95fb7376b869e1288abbd9d16fa77059b07
55 changes: 19 additions & 36 deletions tools/doc/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ function processList(section) {
delete section.list;
}

const paramExpr = /\((.*)\);?$/;

// textRaw = "someobject.someMethod(a[, b=100][, c])"
function parseSignature(text, sig) {
var params = text.match(paramExpr);
Expand Down Expand Up @@ -556,42 +558,23 @@ function deepCopy_(src) {


// These parse out the contents of an H# tag.
const eventExpr = /^Event(?::|\s)+['"]?([^"']+).*$/i;
const classExpr = /^Class:\s*([^ ]+).*$/i;
const propExpr = /^[^.]+\.([^ .()]+)\s*$/;
const braceExpr = /^[^.[]+(\[[^\]]+\])\s*$/;
const classMethExpr = /^class\s*method\s*:?[^.]+\.([^ .()]+)\([^)]*\)\s*$/i;
const methExpr = /^(?:[^.]+\.)?([^ .()]+)\([^)]*\)\s*$/;
const newExpr = /^new ([A-Z][a-zA-Z]+)\([^)]*\)\s*$/;
var paramExpr = /\((.*)\);?$/;

function newSection(tok) {
const section = {};
const headingExpressions = [
{ type: 'event', re: /^Event(?::|\s)+['"]?([^"']+).*$/i },
{ type: 'class', re: /^Class:\s*([^ ]+).*$/i },
{ type: 'property', re: /^[^.[]+(\[[^\]]+\])\s*$/ },
{ type: 'property', re: /^[^.]+\.([^ .()]+)\s*$/ },
{ type: 'classMethod', re: /^class\s*method\s*:?[^.]+\.([^ .()]+)\([^)]*\)\s*$/i },
{ type: 'method', re: /^(?:[^.]+\.)?([^ .()]+)\([^)]*\)\s*$/ },
{ type: 'ctor', re: /^new ([A-Z][a-zA-Z]+)\([^)]*\)\s*$/ },
];

function newSection({ text }) {
// Infer the type from the text.
const text = section.textRaw = tok.text;
if (text.match(eventExpr)) {
section.type = 'event';
section.name = text.replace(eventExpr, '$1');
} else if (text.match(classExpr)) {
section.type = 'class';
section.name = text.replace(classExpr, '$1');
} else if (text.match(braceExpr)) {
section.type = 'property';
section.name = text.replace(braceExpr, '$1');
} else if (text.match(propExpr)) {
section.type = 'property';
section.name = text.replace(propExpr, '$1');
} else if (text.match(classMethExpr)) {
section.type = 'classMethod';
section.name = text.replace(classMethExpr, '$1');
} else if (text.match(methExpr)) {
section.type = 'method';
section.name = text.replace(methExpr, '$1');
} else if (text.match(newExpr)) {
section.type = 'ctor';
section.name = text.replace(newExpr, '$1');
} else {
section.name = text;
for (const { type, re } of headingExpressions) {
const [, name] = text.match(re) || [];
if (name) {
return { textRaw: text, type, name };
}
}
return section;
return { textRaw: text, name: text };
}