Reviewers: Jakob,
Description:
Merged r15610 into 3.19 branch.
HasRealIndexedProperty doesn't work on JSGlobalProxy
[email protected]
BUG=chromium:257748
TEST=cctest/test-api/GlobalObjectHasRealIndexedProperty
Please review this at https://codereview.chromium.org/19690008/
SVN Base: https://v8.googlecode.com/svn/branches/3.19
Affected files:
M src/objects.cc
M src/version.cc
M test/cctest/test-api.cc
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index
e9b7ec2e5bcc3add2144aea1e4c204438d1f4b0f..f8c6564f002793bc2b1781ddbefafbc0d57240b5
100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -3242,7 +3242,6 @@ void JSObject::LocalLookupRealNamedProperty(Name*
name, LookupResult* result) {
Object* proto = GetPrototype();
if (proto->IsNull()) return result->NotFound();
ASSERT(proto->IsJSGlobalObject());
- // A GlobalProxy's prototype should always be a proper JSObject.
return JSObject::cast(proto)->LocalLookupRealNamedProperty(name,
result);
}
@@ -12839,6 +12838,13 @@ bool JSObject::HasRealElementProperty(Isolate*
isolate, uint32_t index) {
}
}
+ if (IsJSGlobalProxy()) {
+ Object* proto = GetPrototype();
+ if (proto->IsNull()) return false;
+ ASSERT(proto->IsJSGlobalObject());
+ return JSObject::cast(proto)->HasRealElementProperty(isolate, index);
+ }
+
return GetElementAttributeWithoutInterceptor(this, index, false) !=
ABSENT;
}
Index: src/version.cc
diff --git a/src/version.cc b/src/version.cc
index
da1be2ec00d7ace9010d896f6ff141c71c29a35a..e927918fce75efe948ec50c133bc59335859f6fd
100644
--- a/src/version.cc
+++ b/src/version.cc
@@ -35,7 +35,7 @@
#define MAJOR_VERSION 3
#define MINOR_VERSION 19
#define BUILD_NUMBER 18
-#define PATCH_LEVEL 14
+#define PATCH_LEVEL 15
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
#define IS_CANDIDATE_VERSION 0
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index
ef82416b6274b24300a3f121d5aa070e60983796..d31c73a507b0f83f8655594de5bd1755a3584410
100755
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -2435,6 +2435,16 @@ THREADED_TEST(GlobalObjectInternalFields) {
}
+THREADED_TEST(GlobalObjectHasRealIndexedProperty) {
+ LocalContext env;
+ v8::HandleScope scope(v8::Isolate::GetCurrent());
+
+ v8::Local<v8::Object> global = env->Global();
+ global->Set(0, v8::String::New("value"));
+ CHECK(global->HasRealIndexedProperty(0));
+}
+
+
static void CheckAlignedPointerInInternalField(Handle<v8::Object> obj,
void* value) {
CHECK_EQ(0, static_cast<int>(reinterpret_cast<uintptr_t>(value) & 0x1));
--
--
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/groups/opt_out.