diff --git a/lib/internal/v8_prof_polyfill.js b/lib/internal/v8_prof_polyfill.js index 34cd10337f12a1..e77f1f76bcb9ee 100644 --- a/lib/internal/v8_prof_polyfill.js +++ b/lib/internal/v8_prof_polyfill.js @@ -105,12 +105,13 @@ function versionCheck() { function macCppfiltNm(out) { // Re-grouped copy-paste from `tickprocessor.js` const FUNC_RE = /^([0-9a-fA-F]{8,16} [iItT] )(.*)$/gm; + const CLEAN_RE = /^[0-9a-fA-F]{8,16} [iItT] /; let entries = out.match(FUNC_RE); if (entries === null) return out; entries = entries.map((entry) => { - return entry.replace(/^[0-9a-fA-F]{8,16} [iItT] /, '') + return entry.replace(CLEAN_RE, '') }); let filtered; @@ -123,7 +124,7 @@ function macCppfiltNm(out) { } let i = 0; - filtered = filtered.split(/\n/g); + filtered = filtered.split('\n'); return out.replace(FUNC_RE, (all, prefix, postfix) => { return prefix + (filtered[i++] || postfix); });