Skip to content

Commit 30e155d

Browse files
RaananWCopilot
andcommitted
TC39 class-fields: convert type-only override fields to declare (TC39 define semantics)
Flipping to TC39 decorators forces `useDefineForClassFields: true`. Under define semantics, an uninitialized narrowing `override` field emits a class-field definition that runs after `super()` and resets the value the base constructor assigned (e.g. FreeCamera/FlyCamera `movement`, and other narrowing overrides), clobbering inherited state and breaking ~96 unit tests. All 134 conversions in this commit are type-only override fields (no initializer): `override` emitted nothing under the old compiler, and `declare` emits nothing under the new one, so each change is provably behavior-identical while removing the clobbering field definition. A blanket conversion is more consistent and robust than a narrow decorated-hierarchy analysis. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent cb6770b commit 30e155d

101 files changed

Lines changed: 142 additions & 136 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/dev/core/src/Actions/condition.pure.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export class ValueCondition extends Condition {
116116
* Internal only The action manager for the condition
117117
* @internal
118118
*/
119-
public override _actionManager: ActionManager;
119+
declare public _actionManager: ActionManager;
120120

121121
private _target: any;
122122
private _effectiveTarget: any;
@@ -218,7 +218,7 @@ export class PredicateCondition extends Condition {
218218
* Internal only - manager for action
219219
* @internal
220220
*/
221-
public override _actionManager: ActionManager;
221+
declare public _actionManager: ActionManager;
222222

223223
/**
224224
* Creates a new PredicateCondition
@@ -249,7 +249,7 @@ export class StateCondition extends Condition {
249249
* Internal only - manager for action
250250
* @internal
251251
*/
252-
public override _actionManager: ActionManager;
252+
declare public _actionManager: ActionManager;
253253

254254
private _target: any;
255255

packages/dev/core/src/AudioV2/abstractAudio/staticSound.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export interface IStaticSoundCloneOptions {
103103
* Static sounds are created by the {@link CreateSoundAsync} function.
104104
*/
105105
export abstract class StaticSound extends AbstractSound {
106-
protected override _instances: Set<_StaticSoundInstance>;
106+
declare protected _instances: Set<_StaticSoundInstance>;
107107
protected abstract override readonly _options: IStaticSoundStoredOptions;
108108

109109
/**

packages/dev/core/src/AudioV2/webAudio/subNodes/spatialWebAudioSubNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class _SpatialWebAudioSubNode extends _SpatialAudioSubNode {
4040
private _positionZ: _WebAudioParameterComponent;
4141

4242
/** @internal */
43-
public override readonly engine: _WebAudioEngine;
43+
declare public readonly engine: _WebAudioEngine;
4444

4545
/** @internal */
4646
public readonly orientation: Vector3 = _SpatialAudioDefaults.orientation.clone();

packages/dev/core/src/AudioV2/webAudio/subNodes/stereoWebAudioSubNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class _StereoWebAudioSubNode extends _StereoAudioSubNode {
1414
private _pan: _WebAudioParameterComponent;
1515

1616
/** @internal */
17-
public override readonly engine: _WebAudioEngine;
17+
declare public readonly engine: _WebAudioEngine;
1818

1919
/** @internal */
2020
public readonly node: StereoPannerNode;

packages/dev/core/src/AudioV2/webAudio/subNodes/volumeWebAudioSubNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export class _VolumeWebAudioSubNode extends _VolumeAudioSubNode implements IWebA
1616
private _volume: _WebAudioParameterComponent;
1717

1818
/** @internal */
19-
public override readonly engine: _WebAudioEngine;
19+
declare public readonly engine: _WebAudioEngine;
2020

2121
/** @internal */
2222
public readonly node: AudioNode;

packages/dev/core/src/AudioV2/webAudio/webAudioBus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class _WebAudioBus extends AudioBus implements IWebAudioSuperNode {
1515
protected _subGraph: _WebAudioBusAndSoundSubGraph;
1616

1717
/** @internal */
18-
public override readonly engine: _WebAudioEngine;
18+
declare public readonly engine: _WebAudioEngine;
1919

2020
/** @internal */
2121
public constructor(name: string, engine: _WebAudioEngine, options: Partial<IAudioBusOptions>) {
@@ -104,7 +104,7 @@ export class _WebAudioBus extends AudioBus implements IWebAudioSuperNode {
104104
}
105105

106106
private static _SubGraph = class extends _WebAudioBusAndSoundSubGraph {
107-
protected override _owner: _WebAudioBus;
107+
declare protected _owner: _WebAudioBus;
108108

109109
protected get _downstreamNodes(): Nullable<Set<AbstractAudioNode>> {
110110
return this._owner._downstreamNodes ?? null;

packages/dev/core/src/AudioV2/webAudio/webAudioMainBus.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class _WebAudioMainBus extends MainAudioBus implements IWebAudioSuperNode
1010
protected _subGraph: _WebAudioBaseSubGraph;
1111

1212
/** @internal */
13-
public override readonly engine: _WebAudioEngine;
13+
declare public readonly engine: _WebAudioEngine;
1414

1515
/** @internal */
1616
public constructor(name: string, engine: _WebAudioEngine) {
@@ -83,7 +83,7 @@ export class _WebAudioMainBus extends MainAudioBus implements IWebAudioSuperNode
8383
}
8484

8585
private static _SubGraph = class extends _WebAudioBaseSubGraph {
86-
protected override _owner: _WebAudioMainBus;
86+
declare protected _owner: _WebAudioMainBus;
8787

8888
protected get _downstreamNodes(): Nullable<Set<AbstractAudioNode>> {
8989
return this._owner._downstreamNodes ?? null;

packages/dev/core/src/AudioV2/webAudio/webAudioMainOut.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class _WebAudioMainOut extends _MainAudioOut implements IWebAudioInNode {
1111
private _volume: _WebAudioParameterComponent;
1212

1313
/** @internal */
14-
public override readonly engine: _WebAudioEngine;
14+
declare public readonly engine: _WebAudioEngine;
1515

1616
/** @internal */
1717
public constructor(engine: _WebAudioEngine) {

packages/dev/core/src/AudioV2/webAudio/webAudioSoundSource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class _WebAudioSoundSource extends AbstractSoundSource {
1919
public _audioContext: AudioContext | OfflineAudioContext;
2020

2121
/** @internal */
22-
public override readonly engine: _WebAudioEngine;
22+
declare public readonly engine: _WebAudioEngine;
2323

2424
/** @internal */
2525
public constructor(name: string, webAudioNode: AudioNode, engine: _WebAudioEngine, options: Partial<ISoundSourceOptions>) {
@@ -125,7 +125,7 @@ export class _WebAudioSoundSource extends AbstractSoundSource {
125125
}
126126

127127
private static _SubGraph = class extends _WebAudioBusAndSoundSubGraph {
128-
protected override _owner: _WebAudioSoundSource;
128+
declare protected _owner: _WebAudioSoundSource;
129129

130130
protected get _downstreamNodes(): Nullable<Set<AbstractAudioNode>> {
131131
return this._owner._downstreamNodes ?? null;

packages/dev/core/src/AudioV2/webAudio/webAudioStaticSound.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ export class _WebAudioStaticSound extends StaticSound implements IWebAudioSuperN
2727
private _buffer: _WebAudioStaticSoundBuffer;
2828
private _stereo: Nullable<_StereoAudio> = null;
2929

30-
protected override readonly _options: IStaticSoundStoredOptions;
30+
declare protected readonly _options: IStaticSoundStoredOptions;
3131
protected _subGraph: _WebAudioBusAndSoundSubGraph;
3232

3333
/** @internal */
3434
public _audioContext: AudioContext | OfflineAudioContext;
3535

3636
/** @internal */
37-
public override readonly engine: _WebAudioEngine;
37+
declare public readonly engine: _WebAudioEngine;
3838

3939
/** @internal */
4040
public constructor(name: string, engine: _WebAudioEngine, options: Partial<IStaticSoundOptions>) {
@@ -172,7 +172,7 @@ export class _WebAudioStaticSound extends StaticSound implements IWebAudioSuperN
172172
}
173173

174174
private static _SubGraph = class extends _WebAudioBusAndSoundSubGraph {
175-
protected override _owner: _WebAudioStaticSound;
175+
declare protected _owner: _WebAudioStaticSound;
176176

177177
protected get _downstreamNodes(): Nullable<Set<AbstractAudioNode>> {
178178
return this._owner._downstreamNodes ?? null;
@@ -190,7 +190,7 @@ export class _WebAudioStaticSoundBuffer extends StaticSoundBuffer {
190190
public _audioBuffer: AudioBuffer;
191191

192192
/** @internal */
193-
public override readonly engine: _WebAudioEngine;
193+
declare public readonly engine: _WebAudioEngine;
194194

195195
/** @internal */
196196
public constructor(engine: _WebAudioEngine) {
@@ -295,11 +295,11 @@ class _WebAudioStaticSoundInstance extends _StaticSoundInstance implements IWebA
295295
private _sourceNode: Nullable<AudioBufferSourceNode> = null;
296296
private _volumeNode: GainNode;
297297

298-
protected override readonly _options: IStaticSoundInstanceOptions;
299-
protected override _sound: _WebAudioStaticSound;
298+
declare protected readonly _options: IStaticSoundInstanceOptions;
299+
declare protected _sound: _WebAudioStaticSound;
300300

301301
/** @internal */
302-
public override readonly engine: _WebAudioEngine;
302+
declare public readonly engine: _WebAudioEngine;
303303

304304
public constructor(sound: _WebAudioStaticSound, options: IStaticSoundInstanceOptions) {
305305
super(sound);

0 commit comments

Comments
 (0)