#760: $.evalFile and a minimal BridgeTalk host identification
Problem: `$.evalFile` always threw, and `typeof BridgeTalk` was `undefined`, so frameworks such as DuAEF failed during initialisation when they load their modules or ask which application they run in. Fix: `$.evalFile(file[, timeout])` evaluates a script file in the global scope and returns its last value. Relative paths resolve against the folder of the file being evaluated (the running script's for the outermost call, else the project's); reads follow the same file gate, 16 MiB size cap and 32-deep nesting limit as `#include` (#759, shared `scriptfile.rs`), and the bracket-depth check runs before parsing. `BridgeTalk` names the host honestly (`appName` "effectcraft", its version, `appSpecifier`, `isRunning` / `getSpecifier` / `getStatus` / `getTargets` for ourselves only); `send()` throws a clear "not supported" error instead of messaging other applications. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9a7d3e7699
commit
88278ea871
@@ -20,7 +20,7 @@
|
||||
//! `ShapeLayer`/`CameraLayer`/`LightLayer`, `PropertyGroup`/`Property` (values, keyframes,
|
||||
//! eases, expressions), `MaskPropertyGroup`, `TextDocument`, `Shape`, `KeyframeEase`,
|
||||
//! `MarkerValue`, `RenderQueue`/`RenderQueueItem`/`OutputModule`, `ImportOptions`, `File`/
|
||||
//! `Folder`, `$`, `alert`/`writeLn`, and the enums (`BlendingMode`, `KeyframeInterpolationType`,
|
||||
//! `Folder`, `$` (with `evalFile`), `BridgeTalk` (host identification), `alert`/`writeLn`, and the enums (`BlendingMode`, `KeyframeInterpolationType`,
|
||||
//! `TrackMatteType`, `LightType`, `ParagraphJustification`, `PropertyValueType`…).
|
||||
//! * **Edits are engine commands**: every mutating call runs a command through
|
||||
//! [`Session::execute`](effectcraft_engine::Session::execute), so it is undoable, journaled
|
||||
@@ -56,6 +56,7 @@
|
||||
pub mod matchnames;
|
||||
mod model;
|
||||
mod runtime;
|
||||
mod scriptfile;
|
||||
mod socket;
|
||||
mod ui;
|
||||
|
||||
@@ -90,3 +91,7 @@ mod tests_panels;
|
||||
mod tests_ui;
|
||||
#[cfg(test)]
|
||||
mod tests_ui_more;
|
||||
|
||||
// #760: `$.evalFile` and `BridgeTalk`.
|
||||
#[cfg(test)]
|
||||
mod tests_evalfile;
|
||||
|
||||
Reference in New Issue
Block a user