* Injects debug information into frequently used types.
()
| 3027 | * Injects debug information into frequently used types. |
| 3028 | */ |
| 3029 | function enableDebugInfo() { |
| 3030 | if (isDebugInfoEnabled) |
| 3031 | return; |
| 3032 | // avoid recomputing |
| 3033 | var weakTypeTextMap; |
| 3034 | var weakNodeTextMap; |
| 3035 | function getWeakTypeTextMap() { |
| 3036 | if (weakTypeTextMap === undefined) { |
| 3037 | if (typeof WeakMap === "function") |
| 3038 | weakTypeTextMap = new WeakMap(); |
| 3039 | } |
| 3040 | return weakTypeTextMap; |
| 3041 | } |
| 3042 | function getWeakNodeTextMap() { |
| 3043 | if (weakNodeTextMap === undefined) { |
| 3044 | if (typeof WeakMap === "function") |
| 3045 | weakNodeTextMap = new WeakMap(); |
| 3046 | } |
| 3047 | return weakNodeTextMap; |
| 3048 | } |
| 3049 | // Add additional properties in debug mode to assist with debugging. |
| 3050 | Object.defineProperties(ts.objectAllocator.getSymbolConstructor().prototype, { |
| 3051 | // for use with vscode-js-debug's new customDescriptionGenerator in launch.json |
| 3052 | __tsDebuggerDisplay: { |
| 3053 | value: function () { |
| 3054 | var symbolHeader = this.flags & 33554432 /* SymbolFlags.Transient */ ? "TransientSymbol" : |
| 3055 | "Symbol"; |
| 3056 | var remainingSymbolFlags = this.flags & ~33554432 /* SymbolFlags.Transient */; |
| 3057 | return "".concat(symbolHeader, " '").concat(ts.symbolName(this), "'").concat(remainingSymbolFlags ? " (".concat(formatSymbolFlags(remainingSymbolFlags), ")") : ""); |
| 3058 | } |
| 3059 | }, |
| 3060 | __debugFlags: { get: function () { return formatSymbolFlags(this.flags); } } |
| 3061 | }); |
| 3062 | Object.defineProperties(ts.objectAllocator.getTypeConstructor().prototype, { |
| 3063 | // for use with vscode-js-debug's new customDescriptionGenerator in launch.json |
| 3064 | __tsDebuggerDisplay: { |
| 3065 | value: function () { |
| 3066 | var typeHeader = this.flags & 98304 /* TypeFlags.Nullable */ ? "NullableType" : |
| 3067 | this.flags & 384 /* TypeFlags.StringOrNumberLiteral */ ? "LiteralType ".concat(JSON.stringify(this.value)) : |
| 3068 | this.flags & 2048 /* TypeFlags.BigIntLiteral */ ? "LiteralType ".concat(this.value.negative ? "-" : "").concat(this.value.base10Value, "n") : |
| 3069 | this.flags & 8192 /* TypeFlags.UniqueESSymbol */ ? "UniqueESSymbolType" : |
| 3070 | this.flags & 32 /* TypeFlags.Enum */ ? "EnumType" : |
| 3071 | this.flags & 67359327 /* TypeFlags.Intrinsic */ ? "IntrinsicType ".concat(this.intrinsicName) : |
| 3072 | this.flags & 1048576 /* TypeFlags.Union */ ? "UnionType" : |
| 3073 | this.flags & 2097152 /* TypeFlags.Intersection */ ? "IntersectionType" : |
| 3074 | this.flags & 4194304 /* TypeFlags.Index */ ? "IndexType" : |
| 3075 | this.flags & 8388608 /* TypeFlags.IndexedAccess */ ? "IndexedAccessType" : |
| 3076 | this.flags & 16777216 /* TypeFlags.Conditional */ ? "ConditionalType" : |
| 3077 | this.flags & 33554432 /* TypeFlags.Substitution */ ? "SubstitutionType" : |
| 3078 | this.flags & 262144 /* TypeFlags.TypeParameter */ ? "TypeParameter" : |
| 3079 | this.flags & 524288 /* TypeFlags.Object */ ? |
| 3080 | this.objectFlags & 3 /* ObjectFlags.ClassOrInterface */ ? "InterfaceType" : |
| 3081 | this.objectFlags & 4 /* ObjectFlags.Reference */ ? "TypeReference" : |
| 3082 | this.objectFlags & 8 /* ObjectFlags.Tuple */ ? "TupleType" : |
| 3083 | this.objectFlags & 16 /* ObjectFlags.Anonymous */ ? "AnonymousType" : |
| 3084 | this.objectFlags & 32 /* ObjectFlags.Mapped */ ? "MappedType" : |
| 3085 | this.objectFlags & 1024 /* ObjectFlags.ReverseMapped */ ? "ReverseMappedType" : |
| 3086 | this.objectFlags & 256 /* ObjectFlags.EvolvingArray */ ? "EvolvingArrayType" : |
no test coverage detected
searching dependent graphs…