I am working on a transcoder for a project and have come across an unusual edge case.
I have the following:
function a(func){
return func.call()
}
for various reasons, the transcoder wants to change it to:
function a(func){
var tmp = func.call;
var res = tmp()
return res;
}
However, the call tmp()returns with tmp is not a function. If I debug and pause only this line, it tmpis defined as a function.
Is this due to the fact that the signature function call(){ [native code]}?
Are there any other functions that will cause such errors?
Is there any way around this other than just not doing it?
EDIT: I found another case, it looks like this might be due to the context of the object:
a = { toString: null }.propertyIsEnumerable
a("toString")
produces the same error.
EDIT: ;
, , . , . , func.call() , , .