There seems to be a lot of controversy on how to properly check if
something should be callable. There isn't any way to determine that in
ES3.
The internal IsCallable determines if an object has a [[Call]] property.
Will that be available as a language feature, not internal?
For example:-
, 2009 1:31 PM
To: es-discuss
Subject: Using IsCallable Operation?
There seems to be a lot of controversy on how to properly check if
something should be callable. There isn't any way to determine that in
ES3.
The internal IsCallable determines if an object has a [[Call]] property
On Fri, Jun 5, 2009 at 1:39 PM, Allen Wirfs-Brock
allen.wirfs-br...@microsoft.com wrote:
Not in ES5. Generally checking that typeof x === 'function' is a close
approximation. ES5 (11.4.3) requires that both native (ie, pure actual
ECMAScript objects) and host objects that implement [[Call]]
-Original Message-
From: Mark S. Miller [mailto:erig...@google.com]
Sent: Friday, June 05, 2009 2:19 PM
To: Allen Wirfs-Brock
Cc: Garrett Smith; es-discuss
Subject: Re: Using IsCallable Operation?
On Fri, Jun 5, 2009 at 1:39 PM, Allen Wirfs-Brock
allen.wirfs-br...@microsoft.com wrote
On Fri, Jun 5, 2009 at 2:18 PM, Mark S. Millererig...@google.com wrote:
On Fri, Jun 5, 2009 at 1:39 PM, Allen Wirfs-Brock
allen.wirfs-br...@microsoft.com wrote:
Not in ES5. Generally checking that typeof x === 'function' is a close
approximation. ES5 (11.4.3) requires that both native (ie,
On Fri, Jun 5, 2009 at 7:22 PM, Garrett Smith dhtmlkitc...@gmail.comwrote:
function isCallable(obj, prop) {
var type = typeof obj[prop];
if(isNewTypeof) {
return type === function;
} else {
// fallback best practice.
}
}
function isCallable(obj, prop) {
var type = typeof
6 matches
Mail list logo