From 4e57fefeec9bef289532501e05bd1b506d3f2576 Mon Sep 17 00:00:00 2001 From: Delan Azabani Date: Wed, 30 Jul 2025 20:58:58 +0800 Subject: [PATCH] Plumb the introductionType into notifyNewSource() Co-authored-by: atbrakhi Signed-off-by: Delan Azabani --- components/script/dom/debuggerglobalscope.rs | 2 +- components/script_bindings/webidls/DebuggerGlobalScope.webidl | 1 + resources/debugger.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/components/script/dom/debuggerglobalscope.rs b/components/script/dom/debuggerglobalscope.rs index 65721a188fb..984e8a5ba20 100644 --- a/components/script/dom/debuggerglobalscope.rs +++ b/components/script/dom/debuggerglobalscope.rs @@ -174,7 +174,7 @@ impl DebuggerGlobalScopeMethods for DebuggerGlobalScope { url: ServoUrl::parse(args.url.str()).expect("Failed to parse url"), external: true, // TODO worker_id: None, // TODO - content: Some(args.text.to_string()), + content: (!args.isInline).then(|| args.text.to_string()), content_type: None, // TODO spidermonkey_id: args.spidermonkeyId, }; diff --git a/components/script_bindings/webidls/DebuggerGlobalScope.webidl b/components/script_bindings/webidls/DebuggerGlobalScope.webidl index 545e68dbe62..bc333e31bbc 100644 --- a/components/script_bindings/webidls/DebuggerGlobalScope.webidl +++ b/components/script_bindings/webidls/DebuggerGlobalScope.webidl @@ -15,6 +15,7 @@ dictionary NotifyNewSource { required unsigned long spidermonkeyId; required DOMString url; required DOMString text; + required boolean isInline; // FIXME: error[E0599]: the method `trace` exists for reference `&Option>`, but // its trait bounds were not satisfied diff --git a/resources/debugger.js b/resources/debugger.js index 4e36466bbfb..646308c85d0 100644 --- a/resources/debugger.js +++ b/resources/debugger.js @@ -19,6 +19,7 @@ if (!("dbg" in this)) { spidermonkeyId: script.source.id, url: script.source.url, text: script.source.text, + isInline: script.source.introductionType == "inlineScript", }); } catch (error) { logError(error);