Skip to content

Commit

Permalink
Pass execution context ID in Debugger.scriptParsed event (#34640)
Browse files Browse the repository at this point in the history
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](#34639).

## Changelog

[General] [Changed] - Correct execution context ID in Debugger.scriptParsed event.

Pull Request resolved: #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
  • Loading branch information
aeulitz authored and facebook-github-bot committed Sep 12, 2022
1 parent 09a910f commit 545366a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions ReactCommon/hermes/inspector/chrome/Connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,7 @@ void Connection::Impl::onScriptParsed(
m::debugger::ScriptParsedNotification note;
note.scriptId = folly::to<std::string>(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;
Expand Down

0 comments on commit 545366a

Please sign in to comment.