| 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.");
|
| +}
|
|
|