mirror of
https://github.com/servo/servo
synced 2026-05-05 22:52:07 +02:00
Previously arrays were falling back to Object previewer which was showing indices as properties- which was not correct. This PR implements dedicated `ArrayPreviewer` that follows Firefox's `ArrayLike` pattern. Currently array preview support only length display, it does not implement showing array items yet. Now(Correct and follows Firefox pattern, Array items coming in a follow-up PR): <img width="510" height="167" alt="image" src="https://github.com/user-attachments/assets/a51f04d4-333c-4d7c-8159-18121c967670" /> Before(We shouldn't see these values- it's incorrect): <img width="1294" height="721" alt="image" src="https://github.com/user-attachments/assets/2218a622-c791-4436-958e-1a5553de7864" /> Testing: Current tests are passing. Fixes: Part of #36027 Signed-off-by: atbrakhi <atbrakhi@igalia.com>
73 lines
2.5 KiB
Plaintext
73 lines
2.5 KiB
Plaintext
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
// This interface is entirely internal to Servo, and should not be accessible to
|
|
// web pages.
|
|
[Exposed=DebuggerGlobalScope]
|
|
interface DebuggerEvalEvent : Event {
|
|
readonly attribute DOMString code;
|
|
readonly attribute PipelineId pipelineId;
|
|
readonly attribute DOMString? workerId;
|
|
readonly attribute DOMString? frameActorId;
|
|
};
|
|
|
|
partial interface DebuggerGlobalScope {
|
|
undefined evalResult(DebuggerEvalEvent event, EvalResultValue result);
|
|
};
|
|
|
|
// Result from Debugger.Object.executeInGlobal() completion value.
|
|
// <https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Object.html#executeinglobal-code-options>
|
|
//
|
|
// Completion values are described at:
|
|
// <https://firefox-source-docs.mozilla.org/js/Debugger/Conventions.html#completion-values>
|
|
// - { return: value } for normal completion
|
|
// - { throw: value, stack } for thrown exception
|
|
// - null for termination
|
|
//
|
|
// The `value` inside is a debuggee value:
|
|
// <https://firefox-source-docs.mozilla.org/js/Debugger/Conventions.html#debuggee-values>
|
|
dictionary EvalResultValue {
|
|
required DOMString completionType;
|
|
required DOMString valueType;
|
|
boolean? booleanValue;
|
|
double? numberValue;
|
|
DOMString? stringValue;
|
|
|
|
// A string naming the ECMAScript [[Class]] of the referent.
|
|
// <https://firefox-source-docs.mozilla.org/js/Debugger/Debugger.Object.html#accessor-properties-of-the-debugger-object-prototype>
|
|
DOMString? objectClass;
|
|
DOMString? name;
|
|
boolean? hasException;
|
|
|
|
// Function-specific metadata
|
|
// <https://searchfox.org/mozilla-central/source/devtools/server/actors/object/previewers.js>
|
|
DOMString? displayName;
|
|
sequence<DOMString>? parameterNames;
|
|
boolean? isAsync;
|
|
boolean? isGenerator;
|
|
|
|
// Object preview properties
|
|
sequence<PropertyPreview>? ownProperties;
|
|
unsigned long? ownPropertiesLength;
|
|
|
|
// Array-specific
|
|
DOMString? kind;
|
|
unsigned long? arrayLength;
|
|
};
|
|
|
|
// TODO: Maybe merge some parts of this with the EvalResultValue
|
|
dictionary PropertyPreview {
|
|
required DOMString name;
|
|
required boolean configurable;
|
|
required boolean enumerable;
|
|
required boolean writable;
|
|
required boolean isAccessor;
|
|
required DOMString valueType;
|
|
boolean? booleanValue;
|
|
double? numberValue;
|
|
DOMString? stringValue;
|
|
DOMString? objectClass;
|
|
DOMString? valueName;
|
|
};
|