[proxies] Improve JSProxyVerify and test most proxy invariants.

BUG=

Review URL: https://codereview.chromium.org/1549793003

Cr-Commit-Position: refs/heads/master@{#33032}
This commit is contained in:
cbruni 2015-12-23 09:37:42 -08:00 committed by Commit bot
parent 5ca478a556
commit f17c1d1140

View File

@ -818,8 +818,14 @@ void JSRegExp::JSRegExpVerify() {
void JSProxy::JSProxyVerify() {
CHECK(IsJSProxy());
VerifyPointer(target());
VerifyPointer(handler());
CHECK_EQ(target()->IsCallable(), map()->is_callable());
CHECK_EQ(target()->IsConstructor(), map()->is_constructor());
CHECK(hash()->IsSmi() || hash()->IsUndefined());
CHECK(map()->prototype()->IsNull());
// There should be no properties on a Proxy.
CHECK_EQ(0, map()->NumberOfOwnDescriptors());
}