| 35346 | const EventEmitter = __webpack_require__(77).EventEmitter; |
| 35347 | |
| 35348 | function stringifyLangArgs(args) { |
| 35349 | return args.map(function (val) { |
| 35350 | if (val != null && val.inspect) { |
| 35351 | return val.inspect(); |
| 35352 | } else { |
| 35353 | try { |
| 35354 | const str = JSON.stringify(val) || val + ''; |
| 35355 | // should match all literal line breaks and |
| 35356 | // "u001b" that follow an odd number of backslashes and convert them to ESC |
| 35357 | // we do this because the JSON.stringify process has escaped these characters |
| 35358 | return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b').replace(/[\\]r[\\]n|([\\])?[\\]n/g, (match, precededBacklash) => { |
| 35359 | // precededBacklash not null when "\n" is preceded by a backlash ("\\n") |
| 35360 | // match will be "\\n" and we don't replace it with os.EOL |
| 35361 | return precededBacklash ? match : (_os || _load_os()).default.EOL; |
| 35362 | }); |
| 35363 | } catch (e) { |
| 35364 | return util.inspect(val); |
| 35365 | } |
| 35366 | } |
| 35367 | }); |
| 35368 | } |
| 35369 | |
| 35370 | class BaseReporter { |
| 35371 | constructor(opts = {}) { |