Tests: the script corpus failure test reads an undefined name

Scripts now have an app object, so app.activeDocument no longer throws a
ReferenceError. The test reads a name the host does not define instead.
This commit is contained in:
dotCooCoo
2026-11-21 11:46:08 -08:00
parent 4bc1f7a187
commit a8d1b29766
+2 -2
View File
@@ -89,9 +89,9 @@ fn a_script_that_ends_well_passes() {
fn a_failure_gives_its_kind_and_place() {
let r = result(&mut session(), &source("var a = 1;\nvar = ;"));
assert_eq!((r["ok"].clone(), r["kind"].clone(), r["line"].clone()), (json!(false), json!("syntax"), json!(2)));
let r = result(&mut session(), &source("var d = app.activeDocument;"));
let r = result(&mut session(), &source("var d = undefinedHost.activeDocument;"));
assert_eq!(r["kind"], "thrown");
assert!(r["message"].as_str().unwrap().starts_with("ReferenceError: app"), "{r}");
assert!(r["message"].as_str().unwrap().starts_with("ReferenceError: undefinedHost"), "{r}");
let r = result(&mut session(), &source("while (true) {}"));
assert_eq!(r["kind"], "limit");
assert!(r["fuelUsed"].as_u64().unwrap() <= FUEL);