Comment #3 on issue 3718 by [email protected]: CallSite.getTypeName() throws TypeError in strict mode
https://code.google.com/p/v8/issues/detail?id=3718

The docs at https://code.google.com/p/v8-wiki/wiki/JavaScriptStackTraceApi only mention that getFunction() and getThis() will return undefined in strict mode. As for the other CallSite functions including getTypeName(), shouldn't they continue to work in strict mode?

In any case, if the intention is for getTypeName() to not work in strict mode, then there is still a bug, because getTypeName() *only* throws an exception if the function is called without a receiver. If the function is called with a receiver--that is, if you changed the invocation f() to f.call({}), then getTypeName() works just fine, returning the string 'Object'.

Furthermore, if the intention is for getTypeName() to not work in strict mode, why does it throw a TypeError instead of just returning undefined, which is the behavior for getFunction() and getThis() in strict mode?

As for the cause of this bug, it is simply a missing definedness check on the receiver argument of GetTypeName here: https://github.com/v8/v8/blob/3.26.31.6/src/messages.js#L1113

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to