diff --git a/src/api.cc b/src/api.cc index 838c72853c..a2abb582a3 100644 --- a/src/api.cc +++ b/src/api.cc @@ -9666,6 +9666,14 @@ v8::debug::Location debug::Script::GetSourceLocation(int offset) const { return debug::Location(info.line, info.column); } +bool debug::Script::SetScriptSource(v8::Local newSource, + bool preview, bool* stack_changed) const { + i::Handle script = Utils::OpenHandle(this); + i::Isolate* isolate = script->GetIsolate(); + return isolate->debug()->SetScriptSource( + script, Utils::OpenHandle(*newSource), preview, stack_changed); +} + debug::WasmScript* debug::WasmScript::Cast(debug::Script* script) { CHECK(script->IsWasm()); return static_cast(script); diff --git a/src/debug/debug-interface.h b/src/debug/debug-interface.h index 532c19f41a..4cd2c97863 100644 --- a/src/debug/debug-interface.h +++ b/src/debug/debug-interface.h @@ -146,6 +146,8 @@ class V8_EXPORT_PRIVATE Script { std::vector* locations) const; int GetSourceOffset(const debug::Location& location) const; v8::debug::Location GetSourceLocation(int offset) const; + bool SetScriptSource(v8::Local newSource, bool preview, + bool* stack_changed) const; }; // Specialization for wasm Scripts. @@ -171,7 +173,7 @@ class DebugDelegate { virtual ~DebugDelegate() {} virtual void PromiseEventOccurred(debug::PromiseDebugActionType type, int id, int parent_id, bool created_by_user) {} - virtual void ScriptCompiled(v8::Local