Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 8d32520252318ceac95219a5f8ea76b8696350a3..77f483c8db28f450a8d547f38aae50c598dec60c 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -446,6 +446,14 @@ Handle<Object> Isolate::CaptureSimpleStackTrace(Handle<JSReceiver> error_object, |
Handle<Object> recv = frames[i].receiver(); |
Handle<AbstractCode> abstract_code = frames[i].abstract_code(); |
+ if (frame->type() == StackFrame::BUILTIN) { |
+ // Help CallSite::IsConstructor correctly detect hand-written |
+ // construct stubs. |
+ Code* code = Code::cast(*abstract_code); |
+ if (code->is_construct_stub()) { |
+ recv = handle(heap()->call_site_constructor_symbol(), this); |
+ } |
+ } |
Handle<Smi> offset(Smi::FromInt(frames[i].code_offset()), this); |
elements = MaybeGrow(this, elements, cursor, cursor + 4); |