Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1363)

Unified Diff: test/cctest/test-api.cc

Issue 914713002: Remove Function.prototype.toMethod (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove comment Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/harmony/super.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « src/messages.js ('k') | test/mjsunit/harmony/super.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698