Commit 1f6c4687 authored by dslomov's avatar dslomov Committed by Commit bot

Test for access checks on super assignments.

R=verwaest@chromium.org
BUG=chromium:470113
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#27438}
parent 1a1e53a3
......@@ -8733,6 +8733,32 @@ TEST(SuperAccessControl) {
}
TEST(Regress470113) {
i::FLAG_harmony_classes = true;
i::FLAG_harmony_object_literals = true;
v8::Isolate* isolate = CcTest::isolate();
v8::HandleScope handle_scope(isolate);
v8::Handle<v8::ObjectTemplate> obj_template =
v8::ObjectTemplate::New(isolate);
obj_template->SetAccessCheckCallbacks(AccessAlwaysBlocked, NULL);
LocalContext env;
env->Global()->Set(v8_str("prohibited"), obj_template->NewInstance());
{
v8::TryCatch try_catch;
CompileRun(
"'use strict';\n"
"class C extends Object {\n"
" m() { super.powned = 'Powned!'; }\n"
"}\n"
"let c = new C();\n"
"c.m.call(prohibited)");
CHECK(try_catch.HasCaught());
}
}
static void ConstTenGetter(Local<String> name,
const v8::PropertyCallbackInfo<v8::Value>& info) {
info.GetReturnValue().Set(v8_num(10));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment