summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/v8_prof_polyfill.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/internal/v8_prof_polyfill.js b/lib/internal/v8_prof_polyfill.js
index 34cd10337f..e77f1f76bc 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);
});