| Index: test/cctest/test-api.cc
|
| diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
|
| index 753b4716b0f6e5b778c7853ea823cbeaa581ffe9..5d07cd884a08ef5f0a7aa05526ba7cc3c2caf8e9 100644
|
| --- a/test/cctest/test-api.cc
|
| +++ b/test/cctest/test-api.cc
|
| @@ -8710,7 +8710,9 @@ THREADED_TEST(AccessControlGetOwnPropertyNames) {
|
|
|
|
|
| TEST(SuperAccessControl) {
|
| + i::FLAG_allow_natives_syntax = true;
|
| 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 =
|
| @@ -8723,8 +8725,8 @@ TEST(SuperAccessControl) {
|
| {
|
| v8::TryCatch try_catch;
|
| CompileRun(
|
| - "function f() { return super.hasOwnProperty; };"
|
| - "var m = f.toMethod(prohibited);"
|
| + "var f = { m() { return super.hasOwnProperty; } }.m;"
|
| + "var m = %ToMethod(f, prohibited);"
|
| "m();");
|
| CHECK(try_catch.HasCaught());
|
| }
|
| @@ -8732,8 +8734,8 @@ TEST(SuperAccessControl) {
|
| {
|
| v8::TryCatch try_catch;
|
| CompileRun(
|
| - "function f() { return super[42]; };"
|
| - "var m = f.toMethod(prohibited);"
|
| + "var f = {m() { return super[42]; } }.m;"
|
| + "var m = %ToMethod(f, prohibited);"
|
| "m();");
|
| CHECK(try_catch.HasCaught());
|
| }
|
| @@ -8741,8 +8743,8 @@ TEST(SuperAccessControl) {
|
| {
|
| v8::TryCatch try_catch;
|
| CompileRun(
|
| - "function f() { super.hasOwnProperty = function () {}; };"
|
| - "var m = f.toMethod(prohibited);"
|
| + "var f = {m() { super.hasOwnProperty = function () {}; } }.m;"
|
| + "var m = %ToMethod(f, prohibited);"
|
| "m();");
|
| CHECK(try_catch.HasCaught());
|
| }
|
| @@ -8751,11 +8753,13 @@ TEST(SuperAccessControl) {
|
| v8::TryCatch try_catch;
|
| CompileRun(
|
| "Object.defineProperty(Object.prototype, 'x', { set : function(){}});"
|
| - "function f() { "
|
| - " 'use strict';"
|
| - " super.x = function () {}; "
|
| - "};"
|
| - "var m = f.toMethod(prohibited);"
|
| + "var f = {"
|
| + " m() { "
|
| + " 'use strict';"
|
| + " super.x = function () {};"
|
| + " }"
|
| + "}.m;"
|
| + "var m = %ToMethod(f, prohibited);"
|
| "m();");
|
| CHECK(try_catch.HasCaught());
|
| }
|
|
|