mirror of
https://github.com/Tonejs/Tone.js
synced 2025-01-16 13:53:56 +00:00
45e4bf11c8
as per the spec.
19 lines
499 B
JavaScript
19 lines
499 B
JavaScript
import Tone from "../core/Tone";
|
|
|
|
/**
|
|
* Makes sure that connect returns the dst node
|
|
* @private
|
|
*/
|
|
if (Tone.supported){
|
|
var testContext = new OfflineAudioContext(2, 1, 44100);
|
|
var testSrcNode = testContext.createGain();
|
|
var testDstNode = testContext.createGain();
|
|
if (testSrcNode.connect(testDstNode) !== testDstNode){
|
|
var nativeConnect = AudioNode.prototype.connect;
|
|
AudioNode.prototype.connect = function(){
|
|
nativeConnect.apply(this, arguments);
|
|
return arguments[0];
|
|
};
|
|
}
|
|
}
|
|
|