Commit 6312804e authored by dslomov@chromium.org's avatar dslomov@chromium.org

Access checks test for stores to 'super'.

R=dcarney@chromium.org
BUG=v8:3330
LOG=N

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24273 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 287bb3b3
......@@ -9656,12 +9656,36 @@ TEST(SuperAccessControl) {
LocalContext env;
env->Global()->Set(v8_str("prohibited"), obj_template->NewInstance());
v8::TryCatch try_catch;
CompileRun(
"function f() { return super.hasOwnProperty; };"
"var m = f.toMethod(prohibited);"
"m();");
CHECK(try_catch.HasCaught());
{
v8::TryCatch try_catch;
CompileRun(
"function f() { return super.hasOwnProperty; };"
"var m = f.toMethod(prohibited);"
"m();");
CHECK(try_catch.HasCaught());
}
{
v8::TryCatch try_catch;
CompileRun(
"function f() { super.hasOwnProperty = function () {}; };"
"var m = f.toMethod(prohibited);"
"m();");
CHECK(try_catch.HasCaught());
}
{
v8::TryCatch try_catch;
CompileRun(
"Object.defineProperty(Object.prototype, 'x', { set : function(){}});"
"function f() { "
" 'use strict';"
" super.x = function () {}; "
"};"
"var m = f.toMethod(prohibited);"
"m();");
CHECK(try_catch.HasCaught());
}
}
......
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