2019-06-23 10:53:57 +00:00
|
|
|
export function isDisposed(instance): void {
|
2019-05-23 18:00:49 +00:00
|
|
|
for (const prop in instance) {
|
2019-06-23 10:53:57 +00:00
|
|
|
if (instance.hasOwnProperty(prop)) {
|
|
|
|
const member = instance[prop];
|
|
|
|
if (typeof member !== "function" &&
|
|
|
|
typeof member !== "string" &&
|
|
|
|
typeof member !== "number" &&
|
|
|
|
typeof member !== "boolean" &&
|
|
|
|
typeof member !== "undefined" &&
|
|
|
|
prop !== "preset" &&
|
|
|
|
!(member instanceof AudioContext)) {
|
|
|
|
if (member !== null) {
|
|
|
|
throw Error("property was not completely disposed: " + prop);
|
|
|
|
}
|
2019-04-12 14:37:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-05-23 18:00:49 +00:00
|
|
|
}
|