enyo.isFunction and NPMethod

edited June 2014 in Enyo 2
I ran into an interesting issue today. I've got an embedded Flash Videoplayer inside my enyo application. This player exposes an API with some methods that can be called as javascript function calls.

I wanted to check if a certain method was exposed on my flash object so I used enyo.isFunction to check for a function. This appears to work just fine on IE10+, Firefox, Opera and Chrome, but Safari seems to cause trouble.
When checking it's type using Object.prototype.toString.call(myFlashNode.apiMethod) the return value is [object NPMethod], not [object Function] as enyo.isFunction asserts.

I think it might be a good idea to either alter enyo.isFunction to accept [object NPMethod] as a 'function' type, or maybe to document this edge-case.


Sign In or Register to comment.