diff --git a/crates/js/src/host_tests.rs b/crates/js/src/host_tests.rs index 9c491af429..d5e3bbe649 100644 --- a/crates/js/src/host_tests.rs +++ b/crates/js/src/host_tests.rs @@ -883,24 +883,6 @@ fn the_handles_of_host_objects_given_to_the_host_count_toward_the_data_limits() assert_eq!(r.run("thing.take([thing, thing]) === undefined").unwrap(), JsValue::Bool(true)); } -#[test] -fn the_object_an_indexer_reads_counts_toward_the_data_limits() { - let mut r = realm(100_000_000); - let index: HostFunction = Rc::new(|_| Ok(Data::Number(1.0))); - let class = HostClass { name: "List".into(), parent: None, members: Vec::new(), info: Vec::new(), index: Some(index), construct: None }; - r.define_host_classes(vec![class], vec![("long".into(), host_ref("List", &[0.0; 1024])), ("short".into(), host_ref("List", &[0.0]))]).unwrap(); - r.set_data_limits(DataLimits { depth: 64, bytes: 16 << 20, entries: 1_000 }); - let probe = "var m = 'none'; try { long[0]; } catch (e) { m = e.name + '|' + e.message; } m"; - let JsValue::String(out) = r.run(probe).unwrap() else { panic!("not a string") }; - assert!(out.starts_with("RangeError|") && out.contains("too many entries"), "{out}"); - // A long name given to the indexer counts too. - r.set_data_limits(DataLimits { depth: 64, bytes: 1_000, entries: 1_000 }); - let probe = "var m = 'none'; try { short[new Array(600).join('x')]; } catch (e) { m = e.name + '|' + e.message; } m"; - let JsValue::String(out) = r.run(probe).unwrap() else { panic!("not a string") }; - assert!(out.starts_with("RangeError|") && out.contains("too large"), "{out}"); - assert_eq!(r.run("short[0] + short.name").unwrap(), JsValue::Number(2.0)); -} - #[test] fn a_host_class_constructor_called_with_new_cannot_wait() { let mut r = realm(1_000_000); diff --git a/docs/mcp.md b/docs/mcp.md index 93966efedd..dabc6a4066 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -2840,11 +2840,12 @@ other files through `$`: - `app` is the application object the help page https://ai-scripting.docsforadobe.dev/jsobjref/Application/ describes: `app.documents`, `app.activeDocument` (assigning an open document makes it the active one), `app.selection` (assigning it sets the active document's selection), `app.coordinateSystem`, - `app.redraw()`, `app.undo()` and `app.redo()`, which run `edit.undo` and `edit.redo` in the active - document and so reach only the steps the run made. The run still ends as one undo step. `app.undo()` and - `app.redo()` with no such step change nothing, and with no document open they throw `No active document` - (VectorCraft's own rules). - `app.getIsFileOpen(path)` and `app.executeMenuCommand(name)`. `executeMenuCommand` runs the command of a menu item + `app.redraw()`, `app.undo()`, `app.redo()`, + `app.getIsFileOpen(path)` and `app.executeMenuCommand(name)`. `app.redraw()` returns without changing + anything. `app.undo()` and `app.redo()` run `edit.undo` and `edit.redo` in the active document and reach + only the steps the run made; with no such step they change nothing, and with no document open they throw + `No active document` (VectorCraft's own rules). After a run that succeeds, each document that was open + before it, is still open and whose content changed has one new undo step. `executeMenuCommand` runs the command of a menu item on the active document, as the type definitions at https://www.indesignjs.de/indesignapi/illustrator/illustrator.d.ts describe the method, and takes these names from the list at https://community.adobe.com/questions-652/a-list-of-illustrator-menu-commands-we-can-call-from-javascript-769510: diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index fbdbcbb6a3..3ab3732826 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1115,7 +1115,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur - Synthetic input validates complete gestures before queue mutation: at most 256 drag steps, 16 clicks and 1,024 pending events; up to 64 control requests per frame, with later requests retained for the next frame (#1709). - The control server writes each reply through a 64 KiB buffer. On Windows 11 it sends the 17 MB `document.inspect` reply of a document with 50,000 objects on one layer to a client over loopback in 0.09 s instead of 34 s. - Scripts: File › Scripts › Other Script… and `script.run` run a JavaScript file against the open documents as one transaction with one undo step for each changed document. A failed or stopped run puts every document back. `crates/engine/src/tests/script_run.rs`. - - Scripts: `app.undo()` and `app.redo()` undo and redo the edits the run made, and the run still ends as one undo step. `crates/engine/src/tests/script_dom.rs`. + - Scripts: `app.undo()` and `app.redo()` undo and redo the edits the run made, and each document open before and after the run that it changed gets one undo step. `crates/engine/src/tests/script_dom.rs`. - Scripts: a text frame's `nextFrame` and `previousFrame` read and set its links to the frames before and after it, `areaText` and `pathText` thread a new frame to a base frame, and `document.stories` lists the stories, each with its frames in thread order and its text across them as one text range with its characters, words and paragraphs, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/TextFrameItem/, https://ai-scripting.docsforadobe.dev/jsobjref/Story/ and https://ai-scripting.docsforadobe.dev/jsobjref/Stories/ describe them; `text.thread.setNeighbor` links or unlinks two frames by id (`docs/mcp.md`). Which links are refused, and how a story is listed and found, are VectorCraft's own rules. `crates/engine/src/tests/script_threads.rs`. - Scripts: `document.textFrames` makes point type, area type and type on a path, and each text frame gives its kind, its contents, its text as text ranges with their characters, words and paragraphs (which can add text), their character attributes (size, leading, tracking, baseline shift, scales, rotation, underline, strikethrough, font) and paragraph attributes (alignment, indents, space before and after), outlines and point and area conversion; `app.textFonts` lists the fonts, as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/TextFrameItems/, https://ai-scripting.docsforadobe.dev/jsobjref/TextFrameItem/, https://ai-scripting.docsforadobe.dev/jsobjref/TextRange/ and https://ai-scripting.docsforadobe.dev/jsobjref/TextFonts/ describe them (`docs/mcp.md`). Offsets count UTF-16 units, VectorCraft's own rule. Lines, styles, tab stops and colors are not there yet. `crates/engine/src/tests/script_text.rs`. - Scripts: `PageItem.tags` reads, adds, renames and deletes an object's tags, name and value pairs that the native file keeps, and `Document.tags` reads, renames and deletes the tags of every page item but adds none (its `add` throws; a script adds a tag through the page item's `tags`), as the help pages https://ai-scripting.docsforadobe.dev/jsobjref/Tags/ and https://ai-scripting.docsforadobe.dev/jsobjref/Tag/ describe them, through `object.tags` and the `object.tag.*` commands, at most 64 tags an object (`docs/mcp.md`). `crates/engine/src/tests/script_tags.rs`.