summaryrefslogtreecommitdiff
path: root/deps/v8/src/inspector/v8-debugger-script.cc
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2020-10-15 20:17:08 +0200
committerMichaël Zasso <targos@protonmail.com>2020-10-18 20:16:47 +0200
commita1d639ba5de4ff34e34fb575fbb6cc1d41ec3cce (patch)
treeabc7d41c12f1495b1208fa4449cb2508c92c5e85 /deps/v8/src/inspector/v8-debugger-script.cc
parent089d654dd85f8e548597329f60a41d6029260caa (diff)
downloadnode-new-a1d639ba5de4ff34e34fb575fbb6cc1d41ec3cce.tar.gz
deps: update V8 to 8.6.395
PR-URL: https://github.com/nodejs/node/pull/35415 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps/v8/src/inspector/v8-debugger-script.cc')
-rw-r--r--deps/v8/src/inspector/v8-debugger-script.cc33
1 files changed, 28 insertions, 5 deletions
diff --git a/deps/v8/src/inspector/v8-debugger-script.cc b/deps/v8/src/inspector/v8-debugger-script.cc
index 7905341481..f345e5eea4 100644
--- a/deps/v8/src/inspector/v8-debugger-script.cc
+++ b/deps/v8/src/inspector/v8-debugger-script.cc
@@ -94,7 +94,8 @@ class ActualScript : public V8DebuggerScript {
bool isLiveEdit, V8DebuggerAgentImpl* agent,
V8InspectorClient* client)
: V8DebuggerScript(isolate, String16::fromInteger(script->Id()),
- GetScriptURL(isolate, script, client)),
+ GetScriptURL(isolate, script, client),
+ GetScriptName(isolate, script, client)),
m_agent(agent),
m_isLiveEdit(isLiveEdit) {
Initialize(script);
@@ -148,9 +149,14 @@ class ActualScript : public V8DebuggerScript {
}
bool isSourceLoadedLazily() const override { return false; }
int length() const override {
+ auto script = this->script();
+ if (script->IsWasm()) {
+ return static_cast<int>(
+ v8::debug::WasmScript::Cast(*script)->Bytecode().size());
+ }
v8::HandleScope scope(m_isolate);
v8::Local<v8::String> v8Source;
- return script()->Source().ToLocal(&v8Source) ? v8Source->Length() : 0;
+ return script->Source().ToLocal(&v8Source) ? v8Source->Length() : 0;
}
const String16& sourceMappingURL() const override {
@@ -169,7 +175,9 @@ class ActualScript : public V8DebuggerScript {
result->message = scope.Escape(result->message);
return;
}
- if (preview) return;
+ // NOP if preview or unchanged source (diffs.empty() in PatchScript)
+ if (preview || result->script.IsEmpty()) return;
+
m_hash = String16();
Initialize(scope.Escape(result->script));
}
@@ -259,6 +267,12 @@ class ActualScript : public V8DebuggerScript {
v8::Local<v8::String> sourceURL;
if (script->SourceURL().ToLocal(&sourceURL) && sourceURL->Length() > 0)
return toProtocolString(isolate, sourceURL);
+ return GetScriptName(isolate, script, client);
+ }
+
+ static String16 GetScriptName(v8::Isolate* isolate,
+ v8::Local<v8::debug::Script> script,
+ V8InspectorClient* client) {
v8::Local<v8::String> v8Name;
if (script->Name().ToLocal(&v8Name) && v8Name->Length() > 0) {
String16 name = toProtocolString(isolate, v8Name);
@@ -290,6 +304,12 @@ class ActualScript : public V8DebuggerScript {
} else {
m_endColumn = source_length + m_startColumn;
}
+ } else if (script->IsWasm()) {
+ DCHECK_EQ(0, m_startLine);
+ DCHECK_EQ(0, m_startColumn);
+ m_endLine = 0;
+ m_endColumn = static_cast<int>(
+ v8::debug::WasmScript::Cast(*script)->Bytecode().size());
} else {
m_endLine = m_startLine;
m_endColumn = m_startColumn;
@@ -345,8 +365,11 @@ std::unique_ptr<V8DebuggerScript> V8DebuggerScript::Create(
}
V8DebuggerScript::V8DebuggerScript(v8::Isolate* isolate, String16 id,
- String16 url)
- : m_id(std::move(id)), m_url(std::move(url)), m_isolate(isolate) {}
+ String16 url, String16 embedderName)
+ : m_id(std::move(id)),
+ m_url(std::move(url)),
+ m_isolate(isolate),
+ m_embedderName(embedderName) {}
V8DebuggerScript::~V8DebuggerScript() = default;