0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/inspector
Vse Mozhet Byt 76340e3f10 test: fix RegExp nits
* Remove needless RegExp flag

  In fixed case, `/g` flag is needless in the boolean context.

* Remove needless RegExp capturing

  Use non-capturing grouping or remove capturing completely when:

  * capturing is useless per se, e.g. in test() check;
  * captured groups are not used afterward at all;
  * some of the later captured groups are not used afterward.

* Use test, not match/exec in boolean context

  match() and exec() return a complicated object,
  unneeded in a boolean context.

* Do not needlessly repeat RegExp creation

  This commit takes RegExp creation out of cycles and other repetitions.

  As long as the RegExp does not use /g flag and match indices,
  we are safe here.

  In tests, this fix hardly gives a significant performance gain,
  but it increases clarity and maintainability,
  reassuring some RegExps to be identical.

  RegExp in functions are not taken out of their functions:
  while these functions are called many times
  and their RegExps are recreated with each call,
  the performance gain in test cases
  does not seem to be worth decreasing function self-dependency.

PR-URL: https://github.com/nodejs/node/pull/13770
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-06-21 03:40:27 +03:00
..
global-function.js inspector: Allows reentry when paused 2017-06-05 08:47:43 -07:00
inspector-helper.js test: fix RegExp nits 2017-06-21 03:40:27 +03:00
inspector.status test: fix test-inspector-port-zero-cluster 2017-06-16 07:14:25 -04:00
test-bindings.js test: skip test-bindings if inspector is disabled 2017-05-26 05:20:26 +02:00
test-inspector-break-when-eval.js inspector: Allows reentry when paused 2017-06-05 08:47:43 -07:00
test-inspector-debug-brk.js test: rearrange inspector headers into convention 2017-06-05 12:28:37 -07:00
test-inspector-exception.js inspector: fix crash on exception 2017-06-09 14:28:17 +03:00
test-inspector-ip-detection.js test: rearrange inspector headers into convention 2017-06-05 12:28:37 -07:00
test-inspector-port-cluster.js inspector,cluster: fix inspect port assignment 2017-06-15 22:50:56 -04:00
test-inspector-port-zero-cluster.js test: fix test-inspector-port-zero-cluster 2017-06-16 07:14:25 -04:00
test-inspector-port-zero.js src: check whether inspector is doing io 2017-06-09 09:10:57 -07:00
test-inspector-stops-no-file.js test: rearrange inspector headers into convention 2017-06-05 12:28:37 -07:00
test-inspector.js test: fix RegExp nits 2017-06-21 03:40:27 +03:00
test-not-blocked-on-idle.js test: make tests pass when configured without-ssl 2017-03-04 20:16:52 +01:00
test-off-no-session.js inspector: fix process._debugEnd() for inspector 2017-05-22 11:18:31 -07:00
test-off-with-session-then-on.js inspector: fix process._debugEnd() for inspector 2017-05-22 11:18:31 -07:00
testcfg.py