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
This commit is contained in:
parent
287bb3b33b
commit
6312804eb3
@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user