On 2014/04/15 10:49:29, rossberg wrote:
https://codereview.chromium.org/236143002/diff/1/src/collection.js
File src/collection.js (right):
https://codereview.chromium.org/236143002/diff/1/src/collection.js#newcode130
src/collection.js:130: if (typeof f !== 'function') {
On 2014/04/14 19:51:49, arv wrote:
> On 2014/04/14 19:15:42, adamk wrote:
> > I think you want IS_SPEC_FUNCTION(f) here, which is a macro expanding
to:
> >
> > %_ClassOf(arg) === 'Function'
>
> IS_SPEC_FUNCTION is not correct any more. It tests that the instance is
a
true
> function. What we really care about is Callable. Most of the IS_SPEC
function
> have been removed in the spec and now the spec checks for Callable
instead.
They are testing the same thing (whether the instance type is either
JS_FUNCTION
or JS_FUNCTION_PROXY -- there are no other callables in V8). However,
IS_SPEC_FUNCTION does not require a runtime call, so is preferable.
Somebody should fix the misleading comment in macros.py :)
How are the callables in DOM represented? We use
ObjectTemplate::SetCallAsFunctionHandler for these
https://code.google.com/p/chromium/codesearch#search/&q=LegacyCallAsFunction%20file:%5C.idl&sq=package:chromium&type=cs
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/bindings/v8/V8NPObject.cpp&l=441
However, all of these return "object" for typeof.
I'll switch to IS_SPEC_OBJECT for consistency.
https://codereview.chromium.org/236143002/
--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.