stacktrace-gps icon indicating copy to clipboard operation
stacktrace-gps copied to clipboard

_findFunctionName regex bug.

Open iansaun opened this issue 8 years ago • 0 comments

Expected Behavior

The "fn_name() {" regex ‌/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*(.?)\s{/ should match code like "fn_name() { stuff"

Current Behavior

The regex matches this code if (a) { foo(); } else if (b) { bar(); } Falsely indicating that foo wraps bar.

Steps to Reproduce (for bugs)

Should be easy to reproduce with a new unit test.

Context

Producing un-minifed stack-traces

Your Environment

  • stacktrace.js version: v2.0.0
  • stacktrace-gps.js version: v3.0

Possible Solution

I'm not familiar with this notation. Suggest removing this regex from the list.

iansaun avatar Aug 23 '17 11:08 iansaun