Closed Bug 934309 Opened 12 years ago Closed 12 years ago

Web Audio Node properties don't respond to "hasOwnProperty"

Categories

(Core :: Web Audio, defect)

25 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: stuartmemo, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1690.2 Safari/537.36 Steps to reproduce: Create oscillator like so... var context = new AudioContext(), osc = context.createOscillator; console.log(osc.context); console.log(osc.hasOwnProperty('context'); Actual results: console.log(osc.context); // logs context. console.log(osc.hasOwnProperty('context')); // returns false Expected results: osc.hasOwnProperty('context') should return true as context property exists.
Typos sorry, corrected code... var context = new AudioContext(), osc = context.createOscillator(); console.log(osc.context); console.log(osc.hasOwnProperty('context'));
Component: Untriaged → Web Audio
Product: Firefox → Core
|context| is a property of AudioNode. Is hasOwnProperty('context') meant to return true for objects with derived interfaces?
I believe hasOwnProperty should work regardless of the object. The fact that it's an object with that property is enough. Might be wrong though!
Looking at that example, I don't even know whether osc.hasOwnProperty('type') should return true.
I believe it should. I think it would be different if I were to create the oscillator node and have it inherit the properties of AudioNode in JavaScript. Because such nodes are native to the browser, hasOwnProperty('whatever') should return true.
No, the Web IDL spec is very clear about that. Why don't you use ('whatever' in osc)?
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Is this because osc.context can't be changed on creation of the oscillator? Yeah, I can easily get around this, I just thought it was a bug as it behaves differently in Chrome. Will raise a bug over there :)
You need to log in before you can comment on or make changes to this bug.