first
This commit is contained in:
16
node_modules/core-js/internals/error-stack-clear.js
generated
vendored
Normal file
16
node_modules/core-js/internals/error-stack-clear.js
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
var uncurryThis = require('../internals/function-uncurry-this');
|
||||
|
||||
var $Error = Error;
|
||||
var replace = uncurryThis(''.replace);
|
||||
|
||||
var TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');
|
||||
// eslint-disable-next-line redos/no-vulnerable -- safe
|
||||
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
|
||||
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
|
||||
|
||||
module.exports = function (stack, dropEntries) {
|
||||
if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
|
||||
while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
|
||||
} return stack;
|
||||
};
|
Reference in New Issue
Block a user