mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-11-03 03:39:20 +08:00
[ts] Fix errors detected by TypeScript 4.3-beta
R=jacktfranklin@chromium.org, tvanderlippe@chromium.org Bug: 1196203 Change-Id: Id04b636db9105d5e84320579b3a6caf426e4c828 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2846326 Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org>
This commit is contained in:
@@ -11,6 +11,7 @@ function toolboxLoaded(): void {
|
||||
if (!window.opener) {
|
||||
return;
|
||||
}
|
||||
// @ts-ignore TypeScript doesn't know about `Emulation` on `Window`.
|
||||
const app = window.opener.Emulation.AdvancedApp._instance();
|
||||
app.toolboxLoaded(document);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,10 @@ export const linkifyNodeReference = function(
|
||||
|
||||
decorateNodeLabel(node, link, options.tooltip);
|
||||
|
||||
link.addEventListener('click', () => Common.Revealer.reveal(node, false) && false, false);
|
||||
link.addEventListener('click', () => {
|
||||
Common.Revealer.reveal(node, false);
|
||||
return false;
|
||||
}, false);
|
||||
link.addEventListener('mouseover', node.highlight.bind(node, undefined), false);
|
||||
link.addEventListener('mouseleave', () => SDK.OverlayModel.OverlayModel.hideDOMNodeHighlight(), false);
|
||||
|
||||
|
||||
@@ -233,7 +233,7 @@ export class Layers3DView extends UI.Widget.VBox implements LayerView {
|
||||
}
|
||||
if (selection.layer()) {
|
||||
const promise = selection.layer().snapshots()[0];
|
||||
if (promise) {
|
||||
if (promise !== undefined) {
|
||||
return promise;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@ export function isNumber(type: ValueType): boolean {
|
||||
}
|
||||
}
|
||||
|
||||
export function getPointerAddress(type: ValueType, buffer: ArrayBuffer, endianness: Endianness): number|BigInt {
|
||||
export function getPointerAddress(type: ValueType, buffer: ArrayBuffer, endianness: Endianness): number|bigint {
|
||||
if (!isPointer(type)) {
|
||||
console.error(`Requesting address of a non-pointer type: ${type}.\n`);
|
||||
return NaN;
|
||||
|
||||
@@ -191,7 +191,7 @@ export class ShortcutRegistry {
|
||||
|
||||
if (this._activePrefixTimeout) {
|
||||
clearTimeout(this._activePrefixTimeout);
|
||||
const handled = maybeExecuteActionForKey.call(this);
|
||||
const handled = await maybeExecuteActionForKey.call(this);
|
||||
this._activePrefixKey = null;
|
||||
this._activePrefixTimeout = null;
|
||||
if (handled) {
|
||||
|
||||
@@ -488,7 +488,10 @@ export class ObjectPropertiesSection extends UI.TreeOutline.TreeOutlineInShadow
|
||||
function didGetDetails(response: SDK.DebuggerModel.FunctionDetails|null): void {
|
||||
if (linkify && response && response.location) {
|
||||
element.classList.add('linkified');
|
||||
element.addEventListener('click', () => Common.Revealer.reveal(response.location) && false);
|
||||
element.addEventListener('click', () => {
|
||||
Common.Revealer.reveal(response.location);
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
// The includePreview flag is false for formats such as console.dir().
|
||||
|
||||
Reference in New Issue
Block a user