(ctx, value, constructor, tag)
| 1570 | } |
| 1571 | |
| 1572 | function getFunctionBase(ctx, value, constructor, tag) { |
| 1573 | const stringified = FunctionPrototypeToString(value); |
| 1574 | if (StringPrototypeStartsWith(stringified, 'class') && stringified[stringified.length - 1] === '}') { |
| 1575 | const slice = StringPrototypeSlice(stringified, 5, -1); |
| 1576 | const bracketIndex = StringPrototypeIndexOf(slice, '{'); |
| 1577 | if (bracketIndex !== -1 && |
| 1578 | (!StringPrototypeIncludes(StringPrototypeSlice(slice, 0, bracketIndex), '(') || |
| 1579 | // Slow path to guarantee that it's indeed a class. |
| 1580 | RegExpPrototypeExec(classRegExp, RegExpPrototypeSymbolReplace(stripCommentsRegExp, slice)) !== null) |
| 1581 | ) { |
| 1582 | return getClassBase(value, constructor, tag); |
| 1583 | } |
| 1584 | } |
| 1585 | let type = 'Function'; |
| 1586 | if (isGeneratorFunction(value)) { |
| 1587 | type = `Generator${type}`; |
| 1588 | } |
| 1589 | if (isAsyncFunction(value)) { |
| 1590 | type = `Async${type}`; |
| 1591 | } |
| 1592 | let base = `[${type}`; |
| 1593 | if (constructor === null) { |
| 1594 | base += ' (null prototype)'; |
| 1595 | } |
| 1596 | if (value.name === '') { |
| 1597 | base += ' (anonymous)'; |
| 1598 | } else { |
| 1599 | base += `: ${typeof value.name === 'string' ? value.name : formatValue(ctx, value.name)}`; |
| 1600 | } |
| 1601 | base += ']'; |
| 1602 | if (constructor !== type && constructor !== null) { |
| 1603 | base += ` ${constructor}`; |
| 1604 | } |
| 1605 | if (tag !== '' && constructor !== tag) { |
| 1606 | base += ` [${tag}]`; |
| 1607 | } |
| 1608 | return base; |
| 1609 | } |
| 1610 | |
| 1611 | function identicalSequenceRange(a, b) { |
| 1612 | for (let i = 0; i < a.length - 3; i++) { |
no test coverage detected
searching dependent graphs…