diff options
Diffstat (limited to 'deps/v8/src/inspector/v8-console.cc')
-rw-r--r-- | deps/v8/src/inspector/v8-console.cc | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/deps/v8/src/inspector/v8-console.cc b/deps/v8/src/inspector/v8-console.cc index faba4a082b9..752b50fa365 100644 --- a/deps/v8/src/inspector/v8-console.cc +++ b/deps/v8/src/inspector/v8-console.cc @@ -24,9 +24,9 @@ namespace v8_inspector { namespace { String16 consoleContextToString( - const v8::debug::ConsoleContext& consoleContext) { + v8::Isolate* isolate, const v8::debug::ConsoleContext& consoleContext) { if (consoleContext.id() == 0) return String16(); - return toProtocolString(consoleContext.name()) + "#" + + return toProtocolString(isolate, consoleContext.name()) + "#" + String16::fromInteger(consoleContext.id()); } @@ -88,7 +88,7 @@ class ConsoleHelper { V8ConsoleMessage::createForConsoleAPI( m_context, m_contextId, m_groupId, m_inspector, m_inspector->client()->currentTimeMS(), type, arguments, - consoleContextToString(m_consoleContext), + consoleContextToString(m_isolate, m_consoleContext), m_inspector->debugger()->captureStackTrace(false)); consoleMessageStorage()->addMessage(std::move(message)); } @@ -124,7 +124,7 @@ class ConsoleHelper { if (!m_info[0]->ToString(m_context).ToLocal(&titleValue)) return defaultValue; } - return toProtocolString(titleValue); + return toProtocolString(m_context->GetIsolate(), titleValue); } v8::MaybeLocal<v8::Object> firstArgAsObject() { @@ -297,7 +297,8 @@ static String16 identifierFromTitleOrStackTrace( } else { identifier = title + "@"; } - identifier = consoleContextToString(consoleContext) + "@" + identifier; + identifier = consoleContextToString(inspector->isolate(), consoleContext) + + "@" + identifier; return identifier; } @@ -370,7 +371,8 @@ static void timeFunction(const v8::debug::ConsoleCallArguments& info, String16 protocolTitle = helper.firstArgToString("default", false); if (timelinePrefix) protocolTitle = "Timeline '" + protocolTitle + "'"; const String16& timerId = - protocolTitle + "@" + consoleContextToString(consoleContext); + protocolTitle + "@" + + consoleContextToString(inspector->isolate(), consoleContext); if (helper.consoleMessageStorage()->hasTimer(helper.contextId(), timerId)) { helper.reportCallWithArgument( ConsoleAPIType::kWarning, @@ -388,7 +390,8 @@ static void timeEndFunction(const v8::debug::ConsoleCallArguments& info, String16 protocolTitle = helper.firstArgToString("default", false); if (timelinePrefix) protocolTitle = "Timeline '" + protocolTitle + "'"; const String16& timerId = - protocolTitle + "@" + consoleContextToString(consoleContext); + protocolTitle + "@" + + consoleContextToString(inspector->isolate(), consoleContext); if (!helper.consoleMessageStorage()->hasTimer(helper.contextId(), timerId)) { helper.reportCallWithArgument( ConsoleAPIType::kWarning, @@ -398,7 +401,8 @@ static void timeEndFunction(const v8::debug::ConsoleCallArguments& info, inspector->client()->consoleTimeEnd(toStringView(protocolTitle)); double elapsed = helper.consoleMessageStorage()->timeEnd( helper.contextId(), - protocolTitle + "@" + consoleContextToString(consoleContext)); + protocolTitle + "@" + + consoleContextToString(inspector->isolate(), consoleContext)); String16 message = protocolTitle + ": " + String16::fromDouble(elapsed) + "ms"; helper.reportCallWithArgument(ConsoleAPIType::kTimeEnd, message); @@ -527,7 +531,8 @@ void V8Console::monitorFunctionCallback( v8::Local<v8::Value> name = function->GetName(); if (!name->IsString() || !v8::Local<v8::String>::Cast(name)->Length()) name = function->GetInferredName(); - String16 functionName = toProtocolStringWithTypeCheck(name); + String16 functionName = + toProtocolStringWithTypeCheck(info.GetIsolate(), name); String16Builder builder; builder.append("console.log(\"function "); if (functionName.isEmpty()) @@ -779,7 +784,8 @@ void V8Console::CommandLineAPIScope::accessorGetterCallback( v8::Local<v8::Value> value; if (!commandLineAPI->Get(context, name).ToLocal(&value)) return; - if (isCommandLineAPIGetter(toProtocolStringWithTypeCheck(name))) { + if (isCommandLineAPIGetter( + toProtocolStringWithTypeCheck(info.GetIsolate(), name))) { DCHECK(value->IsFunction()); v8::MicrotasksScope microtasks(info.GetIsolate(), v8::MicrotasksScope::kDoNotRunMicrotasks); |