diff --git a/lib/domain.js b/lib/domain.js index 7da672a3691560..03d240e98d4506 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -40,6 +40,7 @@ const { ReflectApply, SafeMap, SafeWeakMap, + StringPrototypeRepeat, Symbol, } = primordials; @@ -131,7 +132,7 @@ const domainRequireStack = new Error('require(`domain`) at this point').stack; const { setUncaughtExceptionCaptureCallback } = process; process.setUncaughtExceptionCaptureCallback = function(fn) { const err = new ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE(); - err.stack = err.stack + '\n' + '-'.repeat(40) + '\n' + domainRequireStack; + err.stack += `\n${StringPrototypeRepeat('-', 40)}\n${domainRequireStack}`; throw err; }; diff --git a/lib/repl.js b/lib/repl.js index 6e2d8120ad2167..324835afef7be8 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -53,6 +53,8 @@ const { ArrayPrototypePop, ArrayPrototypePush, ArrayPrototypePushApply, + ArrayPrototypeReduce, + ArrayPrototypeReverse, ArrayPrototypeShift, ArrayPrototypeSlice, ArrayPrototypeSome, @@ -1526,7 +1528,7 @@ function complete(line, callback) { let p; if ((typeof obj === 'object' && obj !== null) || typeof obj === 'function') { - memberGroups.push(filteredOwnPropertyNames(obj)); + ArrayPrototypePush(memberGroups, filteredOwnPropertyNames(obj)); p = ObjectGetPrototypeOf(obj); } else { p = obj.constructor ? obj.constructor.prototype : null; @@ -1534,7 +1536,7 @@ function complete(line, callback) { // Circular refs possible? Let's guard against that. let sentinel = 5; while (p !== null && sentinel-- !== 0) { - memberGroups.push(filteredOwnPropertyNames(p)); + ArrayPrototypePush(memberGroups, filteredOwnPropertyNames(p)); p = ObjectGetPrototypeOf(p); } } catch {