Fix instance lookups that trusted stale data
Two regressions from the template-resolution rework, plus the harness gap that hid them: - `instanceTargetOf` decided from the shape of the id. Unpacking keeps the derived ids, so unpacked content still counted as template content. It now asks whether the object is spelled out in the holder. - The parent picker captured its holder when the row was built. Since `viewOf()` returns a derived copy, the menu listed the objects of that moment (measured: 40 in the model, 17 in the menu). It resolves on open. - `evaluate()` swallowed page exceptions, so a mutate that died half-way let every later check pass or fail for the wrong reason. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ead649eec3
commit
f40b8a0523
5 files changed
+45
-6
No files matched your search
+15
-3
@@ -78,9 +78,21 @@ async function waitForChrome(port) {
|
||||
|
||||
/** The toolbox handed to a check body – everything a step needs to drive and inspect the editor. */
|
||||
function makeTools({ cdp, projectId, baseUrl, consoleLog, check, shotPrefix }) {
|
||||
const evaluate = async (expression) =>
|
||||
(await cdp.send('Runtime.evaluate', { expression, awaitPromise: true, returnByValue: true })).result
|
||||
.value;
|
||||
// A throwing expression is reported, never swallowed: a mutate that dies half-way leaves the
|
||||
// scene in a state no later check describes, and every one of them then passes or fails for the
|
||||
// wrong reason.
|
||||
const evaluate = async (expression) => {
|
||||
const { result, exceptionDetails } = await cdp.send('Runtime.evaluate', {
|
||||
expression,
|
||||
awaitPromise: true,
|
||||
returnByValue: true,
|
||||
});
|
||||
if (exceptionDetails)
|
||||
throw new Error(
|
||||
`page threw: ${exceptionDetails.exception?.description ?? exceptionDetails.text}\n in: ${expression.slice(0, 200)}`,
|
||||
);
|
||||
return result.value;
|
||||
};
|
||||
/** Evaluates an expression in the page and returns it as plain JSON; `undefined` comes back as null. */
|
||||
const json = async (expression) => JSON.parse(await evaluate(`JSON.stringify((${expression}) ?? null)`));
|
||||
const locate = async (text, last = false) => {
|
||||
|
||||
Reference in new issue
Block a user