Skip to content

Commit 9d68231

Browse files
committed
fix: lint error
1 parent a531999 commit 9d68231

File tree

5 files changed

+26
-8
lines changed

5 files changed

+26
-8
lines changed

packages/svelte/src/reactivity/date.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export class ReactiveDate extends Date {
9292
}
9393

9494
if (DEV) {
95+
// @ts-ignore
9596
proto[INSPECT_SYMBOL] = function () {
9697
get(this.#raw_time);
9798
};

packages/svelte/src/reactivity/map.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export class ReactiveMap extends Map {
2626
if (DEV) {
2727
if (!inited) {
2828
inited = true;
29+
// @ts-ignore
2930
ReactiveMap.prototype[INSPECT_SYMBOL] = function () {
3031
// changes could either introduced by
3132
// - modifying the value, or

packages/svelte/src/reactivity/set.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export class ReactiveSet extends Set {
6969
}
7070

7171
if (DEV) {
72+
// @ts-ignore
7273
proto[INSPECT_SYMBOL] = function () {
7374
get(this.#version);
7475
};

packages/svelte/src/reactivity/url.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
import { DEV } from 'esm-env';
12
import { INSPECT_SYMBOL } from '../internal/client/constants.js';
23
import { source, set } from '../internal/client/reactivity/sources.js';
34
import { get } from '../internal/client/runtime.js';
45

56
const REPLACE = Symbol();
7+
var inited_url = false;
8+
var inited_search_params = false;
69

710
export class ReactiveURL extends URL {
811
#protocol = source(super.protocol);
@@ -22,6 +25,14 @@ export class ReactiveURL extends URL {
2225
url = new URL(url, base);
2326
super(url);
2427
this.#searchParams[REPLACE](url.searchParams);
28+
29+
if (DEV && !inited_url) {
30+
inited_url = true;
31+
// @ts-ignore
32+
ReactiveURL.prototype[INSPECT_SYMBOL] = function () {
33+
this.href;
34+
};
35+
}
2536
}
2637

2738
get hash() {
@@ -151,10 +162,6 @@ export class ReactiveURL extends URL {
151162
toJSON() {
152163
return this.href;
153164
}
154-
155-
[INSPECT_SYMBOL]() {
156-
this.href;
157-
}
158165
}
159166

160167
export class ReactiveURLSearchParams extends URLSearchParams {
@@ -164,6 +171,17 @@ export class ReactiveURLSearchParams extends URLSearchParams {
164171
set(this.#version, this.#version.v + 1);
165172
}
166173

174+
constructor() {
175+
super();
176+
if (DEV && !inited_search_params) {
177+
inited_search_params = true;
178+
// @ts-ignore
179+
ReactiveURLSearchParams.prototype[INSPECT_SYMBOL] = function () {
180+
get(this.#version);
181+
};
182+
}
183+
}
184+
167185
/**
168186
* @param {URLSearchParams} params
169187
*/

packages/svelte/types/index.d.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,7 +1972,6 @@ declare module 'svelte/reactivity' {
19721972
class ReactiveDate extends Date {
19731973

19741974
constructor(...values: any[]);
1975-
[INSPECT_SYMBOL](): void;
19761975
#private;
19771976
}
19781977
class ReactiveSet<T> extends Set<any> {
@@ -1988,7 +1987,6 @@ declare module 'svelte/reactivity' {
19881987
values(): IterableIterator<T>;
19891988
entries(): IterableIterator<[T, T]>;
19901989
[Symbol.iterator](): IterableIterator<T>;
1991-
[INSPECT_SYMBOL](): void;
19921990
#private;
19931991
}
19941992
class ReactiveMap<K, V> extends Map<any, any> {
@@ -2008,20 +2006,19 @@ declare module 'svelte/reactivity' {
20082006
values(): IterableIterator<V>;
20092007
entries(): IterableIterator<[K, V]>;
20102008
[Symbol.iterator](): IterableIterator<[K, V]>;
2011-
[INSPECT_SYMBOL](): void;
20122009
#private;
20132010
}
20142011
class ReactiveURL extends URL {
20152012
get searchParams(): ReactiveURLSearchParams;
20162013
#private;
20172014
}
20182015
class ReactiveURLSearchParams extends URLSearchParams {
2016+
constructor();
20192017

20202018
[REPLACE](params: URLSearchParams): void;
20212019
#private;
20222020
}
20232021
const REPLACE: unique symbol;
2024-
const INSPECT_SYMBOL: unique symbol;
20252022

20262023
export { ReactiveDate as Date, ReactiveSet as Set, ReactiveMap as Map, ReactiveURL as URL, ReactiveURLSearchParams as URLSearchParams };
20272024
}

0 commit comments

Comments
 (0)