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

Side by Side 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, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/stack-traces.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins/builtins.h" 5 #include "src/builtins/builtins.h"
6 #include "src/builtins/builtins-utils.h" 6 #include "src/builtins/builtins-utils.h"
7 7
8 #include "src/string-builder.h" 8 #include "src/string-builder.h"
9 #include "src/wasm/wasm-module.h" 9 #include "src/wasm/wasm-module.h"
10 10
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 212
213 Handle<Object> function_obj; 213 Handle<Object> function_obj;
214 Handle<Symbol> symbol = isolate->factory()->call_site_function_symbol(); 214 Handle<Symbol> symbol = isolate->factory()->call_site_function_symbol();
215 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, function_obj, 215 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, function_obj,
216 JSObject::GetProperty(recv, symbol)); 216 JSObject::GetProperty(recv, symbol));
217 217
218 DCHECK(function_obj->IsJSFunction()); 218 DCHECK(function_obj->IsJSFunction());
219 Handle<JSFunction> function = Handle<JSFunction>::cast(function_obj); 219 Handle<JSFunction> function = Handle<JSFunction>::cast(function_obj);
220 Handle<Object> script = handle(function->shared()->script(), isolate); 220 Handle<Object> script = handle(function->shared()->script(), isolate);
221 221
222 if (!script->IsScript()) {
223 return *isolate->factory()->undefined_value();
224 }
225
222 RETURN_RESULT_OR_FAILURE( 226 RETURN_RESULT_OR_FAILURE(
223 isolate, FormatEvalOrigin(isolate, Handle<Script>::cast(script))); 227 isolate, FormatEvalOrigin(isolate, Handle<Script>::cast(script)));
224 } 228 }
225 229
226 BUILTIN(CallSitePrototypeGetFileName) { 230 BUILTIN(CallSitePrototypeGetFileName) {
227 HandleScope scope(isolate); 231 HandleScope scope(isolate);
228 CHECK_CALLSITE(recv, "getFileName"); 232 CHECK_CALLSITE(recv, "getFileName");
229 233
230 CallSite call_site(isolate, recv); 234 CallSite call_site(isolate, recv);
231 CHECK(call_site.IsJavaScript() || call_site.IsWasm()); 235 CHECK(call_site.IsJavaScript() || call_site.IsWasm());
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 BUILTIN(CallSitePrototypeToString) { 384 BUILTIN(CallSitePrototypeToString) {
381 HandleScope scope(isolate); 385 HandleScope scope(isolate);
382 // TODO(jgruber) 386 // TODO(jgruber)
383 return *isolate->factory()->undefined_value(); 387 return *isolate->factory()->undefined_value();
384 } 388 }
385 389
386 #undef CHECK_CALLSITE 390 #undef CHECK_CALLSITE
387 391
388 } // namespace internal 392 } // namespace internal
389 } // namespace v8 393 } // namespace v8
OLDNEW
« 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