Index: src/builtins/builtins-callsite.cc |
diff --git a/src/builtins/builtins-callsite.cc b/src/builtins/builtins-callsite.cc |
index 89b846927da78cae54e16450c4eac7a25a9f3713..c7b273e8438c05c0b5fc8bb0400517eafc397d4f 100644 |
--- a/src/builtins/builtins-callsite.cc |
+++ b/src/builtins/builtins-callsite.cc |
@@ -219,6 +219,10 @@ BUILTIN(CallSitePrototypeGetEvalOrigin) { |
Handle<JSFunction> function = Handle<JSFunction>::cast(function_obj); |
Handle<Object> script = handle(function->shared()->script(), isolate); |
+ if (!script->IsScript()) { |
+ return *isolate->factory()->undefined_value(); |
+ } |
+ |
RETURN_RESULT_OR_FAILURE( |
isolate, FormatEvalOrigin(isolate, Handle<Script>::cast(script))); |
} |