| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 | 2 |
| 3 #include <stdlib.h> | 3 #include <stdlib.h> |
| 4 | 4 |
| 5 #include "v8.h" | 5 #include "v8.h" |
| 6 | 6 |
| 7 #include "compilation-cache.h" | 7 #include "compilation-cache.h" |
| 8 #include "execution.h" | 8 #include "execution.h" |
| 9 #include "factory.h" | 9 #include "factory.h" |
| 10 #include "macro-assembler.h" | 10 #include "macro-assembler.h" |
| (...skipping 2676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2687 #ifdef DEBUG | 2687 #ifdef DEBUG |
| 2688 FLAG_stop_at = "f"; | 2688 FLAG_stop_at = "f"; |
| 2689 #endif | 2689 #endif |
| 2690 CompileRun("%OptimizeFunctionOnNextCall(g);" | 2690 CompileRun("%OptimizeFunctionOnNextCall(g);" |
| 2691 "g(false);"); | 2691 "g(false);"); |
| 2692 | 2692 |
| 2693 // Finish garbage collection cycle. | 2693 // Finish garbage collection cycle. |
| 2694 HEAP->CollectAllGarbage(Heap::kNoGCFlags); | 2694 HEAP->CollectAllGarbage(Heap::kNoGCFlags); |
| 2695 CHECK(shared1->code()->gc_metadata() == NULL); | 2695 CHECK(shared1->code()->gc_metadata() == NULL); |
| 2696 } | 2696 } |
| 2697 |
| 2698 |
| 2699 static v8::Handle<v8::Array> Regress2500Enum(const v8::AccessorInfo& info) { |
| 2700 CHECK(false); // Check that interceptor property names are not enumerated. |
| 2701 return v8::Array::New(); |
| 2702 } |
| 2703 |
| 2704 |
| 2705 TEST(Regress2500) { |
| 2706 v8::HandleScope handle_scope; |
| 2707 LocalContext context; |
| 2708 v8::Context::Scope context_scope(context.local()); |
| 2709 // Create an object with interceptor to enumerate property names. |
| 2710 v8::Handle<v8::ObjectTemplate> tmpl = v8::ObjectTemplate::New(); |
| 2711 tmpl->SetNamedPropertyHandler(NULL, NULL, NULL, NULL, Regress2500Enum); |
| 2712 context->Global()->Set(v8_str("obj"), tmpl->NewInstance()); |
| 2713 // Trigger an exception in an anonymous function with that object as receiver. |
| 2714 // Keep the error object alive for deferred stack trace formatting after GC. |
| 2715 CompileRun("try { " |
| 2716 " (function () { FAIL }).call(object); " |
| 2717 "} catch (e) { " |
| 2718 " error = e; " |
| 2719 "} "); |
| 2720 HEAP->CollectAllAvailableGarbage("trigger deferred stack trace formatting."); |
| 2721 } |
| OLD | NEW |