Skip to content

Commit 0924bd8

Browse files
committed
fix #148 AudioContext.prototype.hasOwnProperty
1 parent 3d62b57 commit 0924bd8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sndcore.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ define(function (require) {
8888
!window.hasOwnProperty('AudioContext')) {
8989
window.AudioContext = webkitAudioContext;
9090

91-
if (!AudioContext.prototype.hasOwnProperty('createGain'))
91+
if (typeof AudioContext.prototype.createGain !== 'function')
9292
AudioContext.prototype.createGain = AudioContext.prototype.createGainNode;
93-
if (!AudioContext.prototype.hasOwnProperty('createDelay'))
93+
if (typeof AudioContext.prototype.createDelay !== 'function')
9494
AudioContext.prototype.createDelay = AudioContext.prototype.createDelayNode;
95-
if (!AudioContext.prototype.hasOwnProperty('createScriptProcessor'))
95+
if (typeof AudioContext.prototype.createScriptProcessor !== 'function')
9696
AudioContext.prototype.createScriptProcessor = AudioContext.prototype.createJavaScriptNode;
97-
if (!AudioContext.prototype.hasOwnProperty('createPeriodicWave'))
97+
if (typeof AudioContext.prototype.createPeriodicWave !== 'function')
9898
AudioContext.prototype.createPeriodicWave = AudioContext.prototype.createWaveTable;
9999

100100

@@ -167,7 +167,7 @@ define(function (require) {
167167
return node;
168168
};
169169

170-
if (AudioContext.prototype.hasOwnProperty( 'createOscillator' )) {
170+
if (typeof AudioContext.prototype.createOscillator !== 'function') {
171171
AudioContext.prototype.internal_createOscillator = AudioContext.prototype.createOscillator;
172172
AudioContext.prototype.createOscillator = function() {
173173
var node = this.internal_createOscillator();

0 commit comments

Comments
 (0)