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

Unified Diff: src/objects.cc

Issue 2147193002: Don't call into JS from within stack trace generation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Just access the script itself, it's what the accessors do 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 | « src/js/messages.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 82336652b20c7e5ef312e3b29a6a848a7b4cab76..95b6c36dd19bb9907a2cb888a2cff856bb983c6a 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -12822,22 +12822,13 @@ int Script::GetLineNumber(int code_pos) {
Handle<Object> Script::GetNameOrSourceURL(Handle<Script> script) {
Isolate* isolate = script->GetIsolate();
- Handle<String> name_or_source_url_key =
- isolate->factory()->InternalizeOneByteString(
- STATIC_CHAR_VECTOR("nameOrSourceURL"));
- Handle<JSObject> script_wrapper = Script::GetWrapper(script);
- Handle<Object> property =
- JSReceiver::GetProperty(script_wrapper, name_or_source_url_key)
- .ToHandleChecked();
- DCHECK(property->IsJSFunction());
- Handle<Object> result;
- // Do not check against pending exception, since this function may be called
- // when an exception has already been pending.
- if (!Execution::TryCall(isolate, property, script_wrapper, 0, NULL)
- .ToHandle(&result)) {
- return isolate->factory()->undefined_value();
+
+ // Keep in sync with ScriptNameOrSourceURL in messages.js.
+
+ if (!script->source_url()->IsUndefined(isolate)) {
+ return handle(script->source_url(), isolate);
}
- return result;
+ return handle(script->name(), isolate);
}
« no previous file with comments | « src/js/messages.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698