Closed bigtimebuddy closed 1 year ago
User on Discord had problems with transpiling with Babel with @babel/plugin-transform-parameters because of the conditional super() calls with the filters. This PR refactors the constructors to rework how to deal with legacy.
@babel/plugin-transform-parameters
class DistortionFilter extends Filter { constructor(amount = 0) { var __super = (...args) => { super(...args); }; if (getInstance().useLegacy) { __super(null); return; } const { context } = getInstance(); const distortion = context.audioContext.createWaveShaper(); __super(distortion); this._distortion = distortion; this.amount = amount; } }
class DistortionFilter extends Filter { constructor(amount = 0) { let distortion; if (!getInstance().useLegacy) { const { audioContext } = getInstance().context; distortion = audioContext.createWaveShaper(); } super(distortion); this._distortion = distortion; this.amount = amount; } }
User on Discord had problems with transpiling with Babel with
@babel/plugin-transform-parameters
because of the conditional super() calls with the filters. This PR refactors the constructors to rework how to deal with legacy.Before
After