Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Unified Diff: src/builtins/builtins-callsite.cc

Issue 2184193004: Handle missing scripts in CallSite.GetEvalOrigin (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle missing scripts in CallSite.GetEvalOrigin Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/stack-traces.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)));
}
« no previous file with comments | « no previous file | test/mjsunit/stack-traces.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698