MCPcopy Index your code
hub / github.com/nodejs/node / enableDebugInfo

Function enableDebugInfo

test/fixtures/snapshot/typescript.js:3029–3205  ·  view source on GitHub ↗

* Injects debug information into frequently used types.

()

Source from the content-addressed store, hash-verified

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" :

Callers 1

extendedDebugFunction · 0.85

Calls 15

formatSymbolFlagsFunction · 0.85
formatObjectFlagsFunction · 0.85
formatTypeFlagsFunction · 0.85
getWeakTypeTextMapFunction · 0.85
formatSignatureFlagsFunction · 0.85
formatSyntaxKindFunction · 0.85
formatNodeFlagsFunction · 0.85
formatModifierFlagsFunction · 0.85
formatTransformFlagsFunction · 0.85
formatEmitFlagsFunction · 0.85
getWeakNodeTextMapFunction · 0.85
concatMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…