benchmark,lib,test,tools: remove unneeded . escape
The `.` character does not need to be escaped when it appears inside a regular expression character class. This removes instances of unnecessary escapes of the `.` character. This also removes a few unnecessary escapes of the `(` and `)` characters within character classes too. PR-URL: https://github.com/nodejs/node/pull/9449 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Minwoo Jung <jmwsoft@gmail.com> Reviewed-By: James Snell <jasnell@gmail.com>
This commit is contained in:
parent
5079763ce7
commit
4463d2b360
@ -37,7 +37,7 @@ AutocannonBenchmarker.prototype.processResults = function(output) {
|
|||||||
|
|
||||||
function WrkBenchmarker() {
|
function WrkBenchmarker() {
|
||||||
this.name = 'wrk';
|
this.name = 'wrk';
|
||||||
this.regexp = /Requests\/sec:[ \t]+([0-9\.]+)/;
|
this.regexp = /Requests\/sec:[ \t]+([0-9.]+)/;
|
||||||
const result = child_process.spawnSync('wrk', ['-h']);
|
const result = child_process.spawnSync('wrk', ['-h']);
|
||||||
this.present = !(result.error && result.error.code === 'ENOENT');
|
this.present = !(result.error && result.error.code === 'ENOENT');
|
||||||
}
|
}
|
||||||
|
@ -919,7 +919,7 @@ Server.prototype.addContext = function(servername, context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var re = new RegExp('^' +
|
var re = new RegExp('^' +
|
||||||
servername.replace(/([\.^$+?\-\\[\]{}])/g, '\\$1')
|
servername.replace(/([.^$+?\-\\[\]{}])/g, '\\$1')
|
||||||
.replace(/\*/g, '[^.]*') +
|
.replace(/\*/g, '[^.]*') +
|
||||||
'$');
|
'$');
|
||||||
this._contexts.push([re, tls.createSecureContext(context).context]);
|
this._contexts.push([re, tls.createSecureContext(context).context]);
|
||||||
|
@ -72,7 +72,7 @@ function error_test() {
|
|||||||
if (read_buffer !== client_unix.expect) {
|
if (read_buffer !== client_unix.expect) {
|
||||||
var expect = client_unix.expect;
|
var expect = client_unix.expect;
|
||||||
if (expect === prompt_multiline)
|
if (expect === prompt_multiline)
|
||||||
expect = /[\.]{3} /;
|
expect = /[.]{3} /;
|
||||||
assert.ok(read_buffer.match(expect));
|
assert.ok(read_buffer.match(expect));
|
||||||
console.error('match');
|
console.error('match');
|
||||||
}
|
}
|
||||||
|
@ -545,12 +545,12 @@ function deepCopy_(src) {
|
|||||||
// these parse out the contents of an H# tag
|
// these parse out the contents of an H# tag
|
||||||
var eventExpr = /^Event(?::|\s)+['"]?([^"']+).*$/i;
|
var eventExpr = /^Event(?::|\s)+['"]?([^"']+).*$/i;
|
||||||
var classExpr = /^Class:\s*([^ ]+).*?$/i;
|
var classExpr = /^Class:\s*([^ ]+).*?$/i;
|
||||||
var propExpr = /^(?:property:?\s*)?[^\.]+\.([^ \.\(\)]+)\s*?$/i;
|
var propExpr = /^(?:property:?\s*)?[^.]+\.([^ .()]+)\s*?$/i;
|
||||||
var braceExpr = /^(?:property:?\s*)?[^\.\[]+(\[[^\]]+\])\s*?$/i;
|
var braceExpr = /^(?:property:?\s*)?[^.\[]+(\[[^\]]+\])\s*?$/i;
|
||||||
var classMethExpr =
|
var classMethExpr =
|
||||||
/^class\s*method\s*:?[^\.]+\.([^ \.\(\)]+)\([^\)]*\)\s*?$/i;
|
/^class\s*method\s*:?[^.]+\.([^ .()]+)\([^)]*\)\s*?$/i;
|
||||||
var methExpr =
|
var methExpr =
|
||||||
/^(?:method:?\s*)?(?:[^\.]+\.)?([^ \.\(\)]+)\([^\)]*\)\s*?$/i;
|
/^(?:method:?\s*)?(?:[^.]+\.)?([^ .()]+)\([^)]*\)\s*?$/i;
|
||||||
var newExpr = /^new ([A-Z][a-zA-Z]+)\([^\)]*\)\s*?$/;
|
var newExpr = /^new ([A-Z][a-zA-Z]+)\([^\)]*\)\s*?$/;
|
||||||
var paramExpr = /\((.*)\);?$/;
|
var paramExpr = /\((.*)\);?$/;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user