Index: test/cctest/test-api.cc |
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc |
index 66dc5a0c4ab0c8bb95f51eac826f971a448b3c66..16912e963161214b10d476d8323d94ccc604a817 100644 |
--- a/test/cctest/test-api.cc |
+++ b/test/cctest/test-api.cc |
@@ -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()); |
+ } |
} |