Reviewers: jochen,
Message:
ptal
Description:
Fix getPrototypeOf for access checked objects
BUG=chromium:509936
Please review this at https://codereview.chromium.org/1242093002/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+6, -13 lines):
M src/runtime/runtime-object.cc
M test/cctest/test-api.cc
Index: src/runtime/runtime-object.cc
diff --git a/src/runtime/runtime-object.cc b/src/runtime/runtime-object.cc
index
0bdde7482c509df9aed274e94738e701c3fb5935..01e57beac444fdd901dd3391c8407ee76d3e7dd4
100644
--- a/src/runtime/runtime-object.cc
+++ b/src/runtime/runtime-object.cc
@@ -193,9 +193,6 @@ MaybeHandle<Object> Runtime::GetPrototype(Isolate*
isolate,
if (PrototypeIterator::GetCurrent(iter)->IsAccessCheckNeeded() &&
!isolate->MayAccess(
Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)))) {
- isolate->ReportFailedAccessCheck(
- Handle<JSObject>::cast(PrototypeIterator::GetCurrent(iter)));
- RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, Object);
return isolate->factory()->undefined_value();
}
iter.AdvanceIgnoringProxies();
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index
4f38198aaf21c4759dfba3e463940501dd2ed4fb..3275fee13fb586b61213e29a4bda3a0614373a2e
100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -18110,14 +18110,14 @@ THREADED_TEST(Regress93759) {
CHECK(result3->Equals(global_object->GetPrototype()));
Local<Value> result4 = CompileRun("Object.getPrototypeOf(proxy)");
- CHECK(result4.IsEmpty());
+ CHECK(result4->IsUndefined());
Local<Value> result5 = CompileRun("Object.getPrototypeOf(hidden)");
CHECK(result5->Equals(
object_with_hidden->GetPrototype()->ToObject(isolate)->GetPrototype()));
Local<Value> result6 = CompileRun("Object.getPrototypeOf(phidden)");
- CHECK(result6.IsEmpty());
+ CHECK(result6.IsUndefined());
}
@@ -21285,14 +21285,10 @@ TEST(GetPrototypeAccessControl) {
env->Global()->Set(v8_str("prohibited"), obj_template->NewInstance());
- {
- v8::TryCatch try_catch(isolate);
- CompileRun(
- "function f() { %_GetPrototype(prohibited); }"
- "%OptimizeFunctionOnNextCall(f);"
- "f();");
- CHECK(try_catch.HasCaught());
- }
+ CHECK(CompileRun(
+ "function f() { return %_GetPrototype(prohibited); }"
+ "%OptimizeFunctionOnNextCall(f);"
+ "f();")->IsUndefined());
}
--
--
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.