Skip to content

Commit 3bf2146

Browse files
Apply suggestions from code review
Co-authored-by: Ben McCann <[email protected]>
1 parent 0c18402 commit 3bf2146

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/kit/src/runtime/client/client.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ if (DEV && BROWSER) {
7070
const warn = () => {
7171
if (warned) return;
7272

73-
// Avoid stashing away the original history methods which prevents monkeypatching by other libs,
74-
// instead inspect the stack trace to see if we're being called from within SvelteKit.
73+
// Rather than saving a pointer to the original history methods, which would prevent monkeypatching by other libs,
74+
// inspect the stack trace to see if we're being called from within SvelteKit.
7575
let stack = new Error().stack?.split('\n');
7676
if (!stack) return;
7777
if (!stack[0].includes('https:') && !stack[0].includes('http:')) stack = stack.slice(1); // Chrome includes the error message in the stack
7878
stack = stack.slice(2); // remove `warn` and the place where `warn` was called
79-
if (stack[0].includes('src/runtime/client/client.js')) return;
79+
if (stack[0].includes(import.meta.url)) return;
8080

8181
warned = true;
8282

0 commit comments

Comments
 (0)