The Wayback Machine - https://web.archive.org/web/20250407172852/https://github.com/nodejs/node/commit/a8909b833e
Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Commit a8909b8

Browse filesBrowse files
TrottMylesBorins
authored andcommitted
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: #9449 Ref: #9749 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>
1 parent 70062f7 commit a8909b8
Copy full SHA for a8909b8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎lib/_tls_wrap.js

Copy file name to clipboardexpand all lines: lib/_tls_wrap.js
+1-1
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ Server.prototype.addContext = function(servername, context) {
936936
}
937937

938938
var re = new RegExp('^' +
939-
servername.replace(/([\.^$+?\-\\[\]{}])/g, '\\$1')
939+
servername.replace(/([.^$+?\-\\[\]{}])/g, '\\$1')
940940
.replace(/\*/g, '[^.]*') +
941941
'$');
942942
this._contexts.push([re, tls.createSecureContext(context).context]);

‎test/parallel/test-repl.js

Copy file name to clipboardexpand all lines: test/parallel/test-repl.js
+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function error_test() {
7272
if (read_buffer !== client_unix.expect) {
7373
let expect = client_unix.expect;
7474
if (expect === prompt_multiline)
75-
expect = /[\.]{3} /;
75+
expect = /[.]{3} /;
7676
assert.ok(read_buffer.match(expect));
7777
console.error('match');
7878
}

‎tools/doc/json.js

Copy file name to clipboardexpand all lines: tools/doc/json.js
+4-4
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,12 @@ function deepCopy_(src) {
545545
// these parse out the contents of an H# tag
546546
var eventExpr = /^Event(?::|\s)+['"]?([^"']+).*$/i;
547547
var classExpr = /^Class:\s*([^ ]+).*?$/i;
548-
var propExpr = /^(?:property:?\s*)?[^\.]+\.([^ \.\(\)]+)\s*?$/i;
549-
var braceExpr = /^(?:property:?\s*)?[^\.\[]+(\[[^\]]+\])\s*?$/i;
548+
var propExpr = /^(?:property:?\s*)?[^.]+\.([^ .()]+)\s*?$/i;
549+
var braceExpr = /^(?:property:?\s*)?[^.\[]+(\[[^\]]+\])\s*?$/i;
550550
var classMethExpr =
551-
/^class\s*method\s*:?[^\.]+\.([^ \.\(\)]+)\([^\)]*\)\s*?$/i;
551+
/^class\s*method\s*:?[^.]+\.([^ .()]+)\([^)]*\)\s*?$/i;
552552
var methExpr =
553-
/^(?:method:?\s*)?(?:[^\.]+\.)?([^ \.\(\)]+)\([^\)]*\)\s*?$/i;
553+
/^(?:method:?\s*)?(?:[^.]+\.)?([^ .()]+)\([^)]*\)\s*?$/i;
554554
var newExpr = /^new ([A-Z][a-zA-Z]+)\([^\)]*\)\s*?$/;
555555
var paramExpr = /\((.*)\);?$/;
556556

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.