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

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

Issue 22990003: Add RemovePrototype to FunctionTemplate (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Test that function throws when constructed Created 7 years, 4 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/objects-inl.h ('k') | no next file » | 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 3be500814533e45ee0b6273f45577438fa35019f..b96d950f9bf5435ad0904350e3a01a1dabe6c317 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -9522,6 +9522,26 @@ THREADED_TEST(SetPrototypeThrows) {
}
+THREADED_TEST(FunctionRemovePrototype) {
+ LocalContext context;
+ v8::HandleScope handle_scope(context->GetIsolate());
+
+ Local<v8::FunctionTemplate> t1 = v8::FunctionTemplate::New();
+ t1->RemovePrototype();
+ Local<v8::Function> fun = t1->GetFunction();
+ context->Global()->Set(v8_str("fun"), fun);
+ CHECK(!CompileRun("'prototype' in fun")->BooleanValue());
+
+ v8::TryCatch try_catch;
+ CompileRun("new fun()");
+ CHECK(try_catch.HasCaught());
+
+ try_catch.Reset();
+ fun->NewInstance();
+ CHECK(try_catch.HasCaught());
+}
+
+
THREADED_TEST(GetterSetterExceptions) {
LocalContext context;
v8::HandleScope handle_scope(context->GetIsolate());
« no previous file with comments | « src/objects-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698