From 545366aea30c3db6cb28c77ce85208e9973cc1fb Mon Sep 17 00:00:00 2001 From: Andreas Eulitz Date: Mon, 12 Sep 2022 06:41:21 -0700 Subject: [PATCH] Pass execution context ID in Debugger.scriptParsed event (#34640) Summary: As generated by ReactCommon code, the CDP [Debugger.scriptParsed](https://chromedevtools.github.io/devtools-protocol/tot/Debugger/#event-scriptParsed) event carries a zero execution context ID. It should match the execution context ID contained in the []() argument of the [Runtime.executionContextCreated](https://chromedevtools.github.io/devtools-protocol/tot/Runtime/#event-executionContextCreated) event. Tracking issue is RN:34639](https://github.com/facebook/react-native/issues/34639). ## Changelog [General] [Changed] - Correct execution context ID in Debugger.scriptParsed event. Pull Request resolved: https://github.com/facebook/react-native/pull/34640 Test Plan: Verified via packet tracer (Wireshark, Chrome DevTools protocol monitor) that Debugger.scriptParsed carries execution context ID. Reviewed By: jpporto Differential Revision: D39385622 Pulled By: mattbfb fbshipit-source-id: 9060041cfa2a784adf4ad371fbe63f530e3362ad --- ReactCommon/hermes/inspector/chrome/Connection.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReactCommon/hermes/inspector/chrome/Connection.cpp b/ReactCommon/hermes/inspector/chrome/Connection.cpp index c3cf75c26d4..842288b0113 100644 --- a/ReactCommon/hermes/inspector/chrome/Connection.cpp +++ b/ReactCommon/hermes/inspector/chrome/Connection.cpp @@ -390,8 +390,7 @@ void Connection::Impl::onScriptParsed( m::debugger::ScriptParsedNotification note; note.scriptId = folly::to(info.fileId); note.url = info.fileName; - // TODO(jpporto): fix test cases sending invalid context id. - // note.executionContextId = kHermesExecutionContextId; + note.executionContextId = kHermesExecutionContextId; if (!info.sourceMappingUrl.empty()) { note.sourceMapURL = info.sourceMappingUrl;