Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 872434606f6d935c418c6b0a09558821c340f575..035a626acd2eff1ba4439ae8b322a2fe3ba93af6 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -605,9 +605,16 @@ |
factory()->NewJSObject(isolate_->object_function()); |
if (!function_key_.is_null()) { |
- Handle<String> name = wasm::GetWasmFunctionName( |
- isolate_, handle(frame->wasm_obj(), isolate_), |
- frame->function_index()); |
+ Object* wasm_object = frame->wasm_obj(); |
+ Handle<String> name; |
+ if (!wasm_object->IsUndefined(isolate_)) { |
+ Handle<JSObject> wasm = handle(JSObject::cast(wasm_object)); |
+ wasm::GetWasmFunctionName(wasm, frame->function_index()) |
+ .ToHandle(&name); |
+ } |
+ if (name.is_null()) { |
+ name = isolate_->factory()->NewStringFromStaticChars("<WASM UNNAMED>"); |
+ } |
JSObject::AddProperty(stack_frame, function_key_, name, NONE); |
} |
// Encode the function index as line number. |