From 71c1f69b068174eaf4b3394f8156ec2fef1cae14 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Fri, 22 Mar 2013 16:37:11 +0000 Subject: [PATCH] Fix global object check in %IsObserved and %SetIsObserved. BUG= Review URL: https://chromiumcodereview.appspot.com/12929024 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14052 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/runtime.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime.cc b/src/runtime.cc index adcc2bc55d..a551d448f1 100644 --- a/src/runtime.cc +++ b/src/runtime.cc @@ -12829,7 +12829,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_IsObserved) { CONVERT_ARG_CHECKED(JSReceiver, obj, 0); if (obj->IsJSGlobalProxy()) { Object* proto = obj->GetPrototype(); - if (obj->IsNull()) return isolate->heap()->false_value(); + if (proto->IsNull()) return isolate->heap()->false_value(); ASSERT(proto->IsJSGlobalObject()); obj = JSReceiver::cast(proto); } @@ -12844,7 +12844,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_SetIsObserved) { CONVERT_BOOLEAN_ARG_CHECKED(is_observed, 1); if (obj->IsJSGlobalProxy()) { Object* proto = obj->GetPrototype(); - if (obj->IsNull()) return isolate->heap()->undefined_value(); + if (proto->IsNull()) return isolate->heap()->undefined_value(); ASSERT(proto->IsJSGlobalObject()); obj = JSReceiver::cast(proto); }