mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 17:55:07 +02:00
This is just a simple getter which returns the audio context that created this audio node.
20 lines
586 B
HTML
20 lines
586 B
HTML
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
const audioContext = new OfflineAudioContext(1, 5000, 44100);
|
|
|
|
const oscillator = audioContext.createOscillator();
|
|
|
|
// Check prototype
|
|
let prototype = Object.getPrototypeOf(oscillator);
|
|
|
|
while (prototype) {
|
|
println(prototype.constructor.name);
|
|
prototype = Object.getPrototypeOf(prototype);
|
|
}
|
|
|
|
// Context getter
|
|
println(`context: '${oscillator.context}, is same as original: ${audioContext === oscillator.context}`);
|
|
});
|
|
</script>
|