Skip to content

Commit 8c852b6

Browse files
committed
Don't pass in enclosing
1 parent bb037d5 commit 8c852b6

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

packages/react-server/src/ReactFlightServer.js

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -206,20 +206,11 @@ function findCalledFunctionNameFromStackTrace(
206206
const url = devirtualizeURL(callsite[1]);
207207
const lineNumber = callsite[2];
208208
const columnNumber = callsite[3];
209-
const enclosingLineNumber = callsite[4];
210-
const enclosingColumnNumber = callsite[5];
211209
if (functionName === 'new Promise') {
212210
// Ignore Promise constructors.
213211
} else if (url === 'node:internal/async_hooks') {
214212
// Ignore the stack frames from the async hooks themselves.
215-
} else if (
216-
filterStackFrame(
217-
url,
218-
functionName,
219-
enclosingLineNumber || lineNumber,
220-
enclosingColumnNumber || columnNumber,
221-
)
222-
) {
213+
} else if (filterStackFrame(url, functionName, lineNumber, columnNumber)) {
223214
if (bestMatch === '') {
224215
// If we had no good stack frames for internal calls, just use the last
225216
// first party function name.
@@ -248,17 +239,8 @@ function filterStackTrace(
248239
const functionName = callsite[0];
249240
const lineNumber = callsite[2];
250241
const columnNumber = callsite[3];
251-
const enclosingLineNumber = callsite[4];
252-
const enclosingColumnNumber = callsite[5];
253242
const url = devirtualizeURL(callsite[1]);
254-
if (
255-
filterStackFrame(
256-
url,
257-
functionName,
258-
enclosingLineNumber || lineNumber,
259-
enclosingColumnNumber || columnNumber,
260-
)
261-
) {
243+
if (filterStackFrame(url, functionName, lineNumber, columnNumber)) {
262244
// Use a clone because the Flight protocol isn't yet resilient to deduping
263245
// objects in the debug info. TODO: Support deduping stacks.
264246
const clone: ReactCallSite = (callsite.slice(0): any);
@@ -2209,13 +2191,11 @@ function visitAsyncNode(
22092191
const url = devirtualizeURL(callsite[1]);
22102192
const lineNumber = callsite[2];
22112193
const columnNumber = callsite[3];
2212-
const enclosingLineNumber = callsite[4];
2213-
const enclosingColumnNumber = callsite[5];
22142194
isAwaitInUserspace = filterStackFrame(
22152195
url,
22162196
functionName,
2217-
enclosingLineNumber || lineNumber,
2218-
enclosingColumnNumber || columnNumber,
2197+
lineNumber,
2198+
columnNumber,
22192199
);
22202200
}
22212201
if (!isAwaitInUserspace) {

0 commit comments

Comments
 (0)