mirror of
https://github.com/bendtherules/ask262.git
synced 2026-08-18 13:21:55 +00:00
feat: add reset method to Ask262Debug and use it in evaluateInEngine262 tool to clear captured marks and internal state.
This commit is contained in:
@@ -113,6 +113,17 @@ class Ask262Debug {
|
|||||||
stopImportant() {
|
stopImportant() {
|
||||||
this._important = false;
|
this._important = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Resets all captured marks and internal state.
|
||||||
|
* Clears marks array, mark index map, and resets flags.
|
||||||
|
*/
|
||||||
|
reset() {
|
||||||
|
this.marks = [];
|
||||||
|
this._markIndex.clear();
|
||||||
|
this._important = false;
|
||||||
|
this._captureEnabled = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export const ask262Debug = new Ask262Debug();
|
export const ask262Debug = new Ask262Debug();
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ export function createEvaluateInEngine262Tool() {
|
|||||||
stopTrace: () => void;
|
stopTrace: () => void;
|
||||||
startImportant: () => void;
|
startImportant: () => void;
|
||||||
stopImportant: () => void;
|
stopImportant: () => void;
|
||||||
|
reset: () => void;
|
||||||
};
|
};
|
||||||
const Agent = engine.Agent;
|
const Agent = engine.Agent;
|
||||||
const ManagedRealm = engine.ManagedRealm;
|
const ManagedRealm = engine.ManagedRealm;
|
||||||
@@ -152,9 +153,8 @@ export function createEvaluateInEngine262Tool() {
|
|||||||
const Value = engine.Value;
|
const Value = engine.Value;
|
||||||
const skipDebugger = engine.skipDebugger;
|
const skipDebugger = engine.skipDebugger;
|
||||||
|
|
||||||
// TODO: Add reset method, allow making instances and use that.
|
// Reset state from previous runs
|
||||||
// Reset marks from previous runs
|
ask262Debug.reset();
|
||||||
ask262Debug.marks = [];
|
|
||||||
|
|
||||||
// Array to capture console output
|
// Array to capture console output
|
||||||
const consoleOutput: ConsoleEntry[] = [];
|
const consoleOutput: ConsoleEntry[] = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user