Skip to content

Commit 9ed20df

Browse files
authored
Fixes CI (microsoft#189440)
1 parent 0e15fee commit 9ed20df

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

src/vs/base/common/observableInternal/autorun.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ export class AutorunObserver<TChangeSummary = any> implements IObserver, IReader
100100
const name = this._debugName();
101101
if (name !== undefined) { return name; }
102102
}
103-
const name = getFunctionName(this.runFn);
103+
const name = getFunctionName(this._runFn);
104104
if (name !== undefined) { return name; }
105105

106106
return '(anonymous)';
107107
}
108108

109109
constructor(
110110
private readonly _debugName: string | (() => string | undefined) | undefined,
111-
private readonly runFn: (reader: IReader, changeSummary: TChangeSummary) => void,
111+
public readonly _runFn: (reader: IReader, changeSummary: TChangeSummary) => void,
112112
private readonly createChangeSummary: (() => TChangeSummary) | undefined,
113113
private readonly _handleChange: ((context: IChangeContext, summary: TChangeSummary) => boolean) | undefined,
114114
) {
@@ -141,7 +141,7 @@ export class AutorunObserver<TChangeSummary = any> implements IObserver, IReader
141141
getLogger()?.handleAutorunTriggered(this);
142142
const changeSummary = this.changeSummary!;
143143
this.changeSummary = this.createChangeSummary?.();
144-
this.runFn(this, changeSummary);
144+
this._runFn(this, changeSummary);
145145
}
146146
} finally {
147147
getLogger()?.handleAutorunFinished(this);

src/vs/base/common/observableInternal/base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,15 +225,15 @@ export function subtransaction(tx: ITransaction | undefined, fn: (tx: ITransacti
225225
export class TransactionImpl implements ITransaction {
226226
private updatingObservers: { observer: IObserver; observable: IObservable<any> }[] | null = [];
227227

228-
constructor(private readonly fn: Function, private readonly _getDebugName?: () => string) {
228+
constructor(public readonly _fn: Function, private readonly _getDebugName?: () => string) {
229229
getLogger()?.handleBeginTransaction(this);
230230
}
231231

232232
public getDebugName(): string | undefined {
233233
if (this._getDebugName) {
234234
return this._getDebugName();
235235
}
236-
return getFunctionName(this.fn);
236+
return getFunctionName(this._fn);
237237
}
238238

239239
public updateObserver(observer: IObserver, observable: IObservable<any>): void {

src/vs/base/common/observableInternal/derived.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
6868

6969
public override get debugName(): string {
7070
if (!this._debugName) {
71-
return getFunctionName(this.computeFn) || '(anonymous)';
71+
return getFunctionName(this._computeFn) || '(anonymous)';
7272
}
7373
return typeof this._debugName === 'function' ? this._debugName() : this._debugName;
7474
}
7575

7676
constructor(
7777
private readonly _debugName: string | (() => string) | undefined,
78-
private readonly computeFn: (reader: IReader, changeSummary: TChangeSummary) => T,
78+
public readonly _computeFn: (reader: IReader, changeSummary: TChangeSummary) => T,
7979
private readonly createChangeSummary: (() => TChangeSummary) | undefined,
8080
private readonly _handleChange: ((context: IChangeContext, summary: TChangeSummary) => boolean) | undefined,
8181
private readonly _handleLastObserverRemoved: (() => void) | undefined = undefined
@@ -104,7 +104,7 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
104104
if (this.observers.size === 0) {
105105
// Without observers, we don't know when to clean up stuff.
106106
// Thus, we don't cache anything to prevent memory leaks.
107-
const result = this.computeFn(this, this.createChangeSummary?.()!);
107+
const result = this._computeFn(this, this.createChangeSummary?.()!);
108108
// Clear new dependencies
109109
this.onLastObserverRemoved();
110110
return result;
@@ -153,7 +153,7 @@ export class Derived<T, TChangeSummary = any> extends BaseObservable<T, void> im
153153
this.changeSummary = this.createChangeSummary?.();
154154
try {
155155
/** might call {@link handleChange} indirectly, which could invalidate us */
156-
this.value = this.computeFn(this, changeSummary);
156+
this.value = this._computeFn(this, changeSummary);
157157
} finally {
158158
// We don't want our observed observables to think that they are (not even temporarily) not being observed.
159159
// Thus, we only unsubscribe from observables that are definitely not read anymore.

src/vs/base/common/observableInternal/logging.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export class ConsoleObservableLogger implements IObservableLogger {
114114
styled(derived.debugName, { color: 'BlueViolet' }),
115115
...this.formatInfo(info),
116116
this.formatChanges(changedObservables),
117-
{ data: [{ fn: derived['computeFn'] }] }
117+
{ data: [{ fn: derived._computeFn }] }
118118
]));
119119
changedObservables.clear();
120120
}
@@ -124,7 +124,7 @@ export class ConsoleObservableLogger implements IObservableLogger {
124124
formatKind('observable from event triggered'),
125125
styled(observable.debugName, { color: 'BlueViolet' }),
126126
...this.formatInfo(info),
127-
{ data: [{ fn: observable['getValue'] }] }
127+
{ data: [{ fn: observable._getValue }] }
128128
]));
129129
}
130130

@@ -143,7 +143,7 @@ export class ConsoleObservableLogger implements IObservableLogger {
143143
formatKind('autorun'),
144144
styled(autorun.debugName, { color: 'BlueViolet' }),
145145
this.formatChanges(changedObservables),
146-
{ data: [{ fn: autorun['runFn'] }] }
146+
{ data: [{ fn: autorun._runFn }] }
147147
]));
148148
changedObservables.clear();
149149
this.indentation++;
@@ -161,7 +161,7 @@ export class ConsoleObservableLogger implements IObservableLogger {
161161
console.log(...this.textToConsoleArgs([
162162
formatKind('transaction'),
163163
styled(transactionName, { color: 'BlueViolet' }),
164-
{ data: [{ fn: transaction['fn'] }] }
164+
{ data: [{ fn: transaction._fn }] }
165165
]));
166166
this.indentation++;
167167
}

src/vs/base/common/observableInternal/utils.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,13 @@ export class FromEventObservable<TArgs, T> extends BaseObservable<T> {
8989

9090
constructor(
9191
private readonly event: Event<TArgs>,
92-
private readonly getValue: (args: TArgs | undefined) => T
92+
public readonly _getValue: (args: TArgs | undefined) => T
9393
) {
9494
super();
9595
}
9696

9797
private getDebugName(): string | undefined {
98-
return getFunctionName(this.getValue);
98+
return getFunctionName(this._getValue);
9999
}
100100

101101
public get debugName(): string {
@@ -108,7 +108,7 @@ export class FromEventObservable<TArgs, T> extends BaseObservable<T> {
108108
}
109109

110110
private readonly handleEvent = (args: TArgs | undefined) => {
111-
const newValue = this.getValue(args);
111+
const newValue = this._getValue(args);
112112

113113
const didChange = !this.hasValue || this.value !== newValue;
114114

@@ -150,7 +150,7 @@ export class FromEventObservable<TArgs, T> extends BaseObservable<T> {
150150
return this.value!;
151151
} else {
152152
// no cache, as there are no subscribers to keep it updated
153-
return this.getValue(undefined);
153+
return this._getValue(undefined);
154154
}
155155
}
156156
}

0 commit comments

Comments
 (0)