MCPcopy
hub / github.com/facebook/react / devirtualizeURL

Function devirtualizeURL

packages/react-server/src/ReactFlightServer.js:184–197  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

182}
183
184function devirtualizeURL(url: string): string {
185 if (url.startsWith('about://React/')) {
186 // This callsite is a virtual fake callsite that came from another Flight client.
187 // We need to reverse it back into the original location by stripping its prefix
188 // and suffix. We don't need the environment name because it's available on the
189 // parent object that will contain the stack.
190 const envIdx = url.indexOf('/', 'about://React/'.length);
191 const suffixIdx = url.lastIndexOf('?');
192 if (envIdx > -1 && suffixIdx > -1) {
193 return decodeURI(url.slice(envIdx + 1, suffixIdx));
194 }
195 }
196 return url;
197}
198
199function isPromiseCreationInternal(url: string, functionName: string): boolean {
200 // Various internals of the JS VM can create Promises but the call frame of the

Callers 4

filterStackTraceFunction · 0.85
hasUnfilteredFrameFunction · 0.85
isAwaitInUserspaceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected