bippy 0.7.3-dev.049a43d → 0.7.3-dev.0ac832d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -0
- package/README.md +1 -8
- package/dist/core.cjs +1 -1
- package/dist/core.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +10 -7
- package/dist/index.js +1 -1
- package/dist/rdt-hook.cjs +1 -1
- package/dist/rdt-hook.js +1 -1
- package/dist/source.cjs +11 -12
- package/dist/source.js +12 -13
- package/package.json +3 -31
- package/src/call-listener.ts +13 -0
- package/src/core.ts +154 -203
- package/src/rdt-hook.ts +7 -4
- package/src/react-internals/current-fiber.ts +84 -0
- package/src/react-internals/index.ts +38 -11
- package/src/react.ts +141 -56
- package/src/source/inspect-hooks.ts +29 -21
- package/src/source/parse-stack.ts +111 -63
- package/src/source/symbolication.ts +15 -4
|
@@ -207,6 +207,13 @@ export const getSourceFromSourceMap = (
|
|
|
207
207
|
);
|
|
208
208
|
};
|
|
209
209
|
|
|
210
|
+
const getStringIndex = (values: string[], target: string): number => {
|
|
211
|
+
for (let valueIndex = 0; valueIndex < values.length; valueIndex++) {
|
|
212
|
+
if (values[valueIndex] === target) return valueIndex;
|
|
213
|
+
}
|
|
214
|
+
return -1;
|
|
215
|
+
};
|
|
216
|
+
|
|
210
217
|
const getSourceFromMappingsByFunctionName = (
|
|
211
218
|
mappings: SourceMapMappings,
|
|
212
219
|
sources: string[],
|
|
@@ -215,13 +222,17 @@ const getSourceFromMappingsByFunctionName = (
|
|
|
215
222
|
ignoredSourceIndices?: Set<number>,
|
|
216
223
|
): StackFrame | null => {
|
|
217
224
|
if (!names) return null;
|
|
218
|
-
const functionNameIndex = names
|
|
225
|
+
const functionNameIndex = getStringIndex(names, functionName);
|
|
219
226
|
if (functionNameIndex === -1) return null;
|
|
220
227
|
|
|
221
228
|
let ignoredSource: StackFrame | null = null;
|
|
222
|
-
for (
|
|
223
|
-
|
|
229
|
+
for (let lineIndex = 0; lineIndex < mappings.length; lineIndex++) {
|
|
230
|
+
const lineMapping = mappings[lineIndex];
|
|
231
|
+
for (let segmentIndex = 0; segmentIndex < lineMapping.length; segmentIndex++) {
|
|
232
|
+
const segment = lineMapping[segmentIndex];
|
|
224
233
|
if (segment[4] !== functionNameIndex) continue;
|
|
234
|
+
if (ignoredSource && segment[1] !== undefined && ignoredSourceIndices?.has(segment[1]))
|
|
235
|
+
continue;
|
|
225
236
|
const source = getSourceFromSegment(segment, sources, ignoredSourceIndices, names);
|
|
226
237
|
if (!source) continue;
|
|
227
238
|
if (!source.isIgnoreListed) return source;
|
|
@@ -267,7 +278,7 @@ const findSourceContentByFileName = (
|
|
|
267
278
|
fileName: string,
|
|
268
279
|
): string | null => {
|
|
269
280
|
if (!sourcesContent) return null;
|
|
270
|
-
const sourceIndex = sources
|
|
281
|
+
const sourceIndex = getStringIndex(sources, fileName);
|
|
271
282
|
return sourceIndex === -1 ? null : (sourcesContent[sourceIndex] ?? null);
|
|
272
283
|
};
|
|
273
284
|
|