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

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

Issue 11971015: Skip stack trace formatting in case the global object is already dead. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fix leaks in the setter. Created 7 years, 11 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 | « test/cctest/cctest.status ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 634deefbfb2190e5d94c31d08ac9ace20eef6ef5..24b0ca624d8d2b4b916d641dd046355d517cf8b6 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -2694,3 +2694,28 @@ TEST(Regress169209) {
HEAP->CollectAllGarbage(Heap::kNoGCFlags);
CHECK(shared1->code()->gc_metadata() == NULL);
}
+
+
+static v8::Handle<v8::Array> Regress2500Enum(const v8::AccessorInfo& info) {
+ CHECK(false); // Check that interceptor property names are not enumerated.
+ return v8::Array::New();
+}
+
+
+TEST(Regress2500) {
+ v8::HandleScope handle_scope;
+ LocalContext context;
+ v8::Context::Scope context_scope(context.local());
+ // Create an object with interceptor to enumerate property names.
+ v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New();
+ tmpl->SetNamedPropertyHandler(NULL, NULL, NULL, NULL, Regress2500Enum);
+ context->Global()->Set(v8_str("obj"), tmpl->NewInstance());
+ // Trigger an exception in an anonymous function with that object as receiver.
+ // Keep the error object alive for deferred stack trace formatting after GC.
+ CompileRun("try { "
+ " (function () { FAIL }).call(object); "
+ "} catch (e) { "
+ " error = e; "
+ "} ");
+ HEAP->CollectAllAvailableGarbage("trigger deferred stack trace formatting.");
+}
« no previous file with comments | « test/cctest/cctest.status ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698