From 8dd16259287f58f9273002717ec4d27e97127719 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 12 Jun 2024 07:43:14 +0200 Subject: Merging upstream version 127.0. Signed-off-by: Daniel Baumann --- devtools/server/actors/utils/sources-manager.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'devtools/server/actors/utils/sources-manager.js') diff --git a/devtools/server/actors/utils/sources-manager.js b/devtools/server/actors/utils/sources-manager.js index fda37a3184..981a7c8213 100644 --- a/devtools/server/actors/utils/sources-manager.js +++ b/devtools/server/actors/utils/sources-manager.js @@ -101,7 +101,8 @@ class SourcesManager extends EventEmitter { this._thread.threadLifetimePool.manage(actor); this._sourceActors.set(source, actor); - if (this._sourcesByInternalSourceId && source.id) { + // source.id can be 0 for WASM sources + if (this._sourcesByInternalSourceId && Number.isInteger(source.id)) { this._sourcesByInternalSourceId.set(source.id, source); } @@ -157,7 +158,8 @@ class SourcesManager extends EventEmitter { if (!this._sourcesByInternalSourceId) { this._sourcesByInternalSourceId = new Map(); for (const source of this._thread.dbg.findSources()) { - if (source.id) { + // source.id can be 0 for WASM sources + if (Number.isInteger(source.id)) { this._sourcesByInternalSourceId.set(source.id, source); } } -- cgit v1.2.3