summaryrefslogtreecommitdiff
path: root/tools/doc/json.js
diff options
context:
space:
mode:
authorPrince J Wesley <princejohnwesley@gmail.com>2016-11-14 12:53:35 +0530
committerRich Trott <rtrott@gmail.com>2016-11-23 22:06:24 -0800
commit0f4c7b8c371caae4cd4a2cb1fa03d2079f75663d (patch)
tree116e98d6218afb2472fb9443bfecf3b0694623b8 /tools/doc/json.js
parentc1133f41b6566bc9ce25d4ac0b83f038ccdacc71 (diff)
downloadandroid-node-v8-0f4c7b8c371caae4cd4a2cb1fa03d2079f75663d.tar.gz
android-node-v8-0f4c7b8c371caae4cd4a2cb1fa03d2079f75663d.tar.bz2
android-node-v8-0f4c7b8c371caae4cd4a2cb1fa03d2079f75663d.zip
lib,tools: remove unneeded escaping of /
The `/` character does not need to be escaped when occurring inside a character class in a regular expression. Remove such instances of escaping in the code base. PR-URL: https://github.com/nodejs/node/pull/9591 Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Diffstat (limited to 'tools/doc/json.js')
-rw-r--r--tools/doc/json.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/doc/json.js b/tools/doc/json.js
index a782c54028..f8210ef17f 100644
--- a/tools/doc/json.js
+++ b/tools/doc/json.js
@@ -31,7 +31,7 @@ function doJSON(input, filename, cb) {
// <!-- type = module -->
// This is for cases where the markdown semantic structure is lacking.
if (type === 'paragraph' || type === 'html') {
- var metaExpr = /<!--([^=]+)=([^\-]+)-->\n*/g;
+ var metaExpr = /<!--([^=]+)=([^-]+)-->\n*/g;
text = text.replace(metaExpr, function(_0, k, v) {
current[k.trim()] = v.trim();
return '';
@@ -371,7 +371,7 @@ function parseListItem(item) {
item.name = 'return';
text = text.replace(retExpr, '');
} else {
- var nameExpr = /^['`"]?([^'`": \{]+)['`"]?\s*:?\s*/;
+ var nameExpr = /^['`"]?([^'`": {]+)['`"]?\s*:?\s*/;
var name = text.match(nameExpr);
if (name) {
item.name = name[1];
@@ -388,7 +388,7 @@ function parseListItem(item) {
}
text = text.trim();
- var typeExpr = /^\{([^\}]+)\}/;
+ var typeExpr = /^\{([^}]+)\}/;
var type = text.match(typeExpr);
if (type) {
item.type = type[1];
@@ -551,7 +551,7 @@ var classMethExpr =
/^class\s*method\s*:?[^.]+\.([^ .()]+)\([^)]*\)\s*?$/i;
var methExpr =
/^(?:method:?\s*)?(?:[^.]+\.)?([^ .()]+)\([^)]*\)\s*?$/i;
-var newExpr = /^new ([A-Z][a-zA-Z]+)\([^\)]*\)\s*?$/;
+var newExpr = /^new ([A-Z][a-zA-Z]+)\([^)]*\)\s*?$/;
var paramExpr = /\((.*)\);?$/;
function newSection(tok) {