mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
new ExternalObject("lib:AdobeXMPScript") defines XMPMeta, XMPFile and
XMPConst in the script engine; any other library name throws and no
native library is loaded.
- XMPMeta reads a packet string and serializes one, with or without the
packet wrapper: simple properties, arrays of simple items, language
alternatives and namespace registration and lookup. Structures and
values with qualifiers are kept as they were written.
- XMPFile reads and writes only where File may. A .xmp sidecar opened
for update takes putXMP, and closeFile writes it through a temporary
file in the same folder when the script may write there; other files
are scanned for their packet and are read only. File's 8 MiB limit
applies before reading.
- Packets are parsed with craft-xml: a document type declaration, an
undefined entity, nesting over 64 levels and a packet over 8 MiB are
refused with an error.
- Members not built yet (iterators, structure fields, qualifiers,
aliases, sorting, byte-array packets, XMPFile.getFormatInfo) throw
that they are not available yet.
The XMPConst flag values follow the public XMP Toolkit SDK header
XMP_Const.h. Tests: crates/js/src/xmp_tests.rs, with fuzz cases for the
packet parser and scanner, and crates/engine/src/tests/script_xmp.rs.
Docs: docs/mcp.md and docs/target-app-parity.md.
28 lines
984 B
TOML
28 lines
984 B
TOML
[package]
|
|
name = "vectorcraft-js"
|
|
description = "JavaScript for scripts: an ECMAScript 5.1 parser, and an interpreter with a garbage-collected heap and execution limits"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
license.workspace = true
|
|
rust-version.workspace = true
|
|
|
|
[lints]
|
|
workspace = true
|
|
|
|
[dependencies]
|
|
chrono = { workspace = true }
|
|
# The XMP packets of XMPMeta and XMPFile (xmp.rs).
|
|
craft-xml = { workspace = true }
|
|
# Unicode 17.0 general categories for identifiers (chars.rs). 0.1.5 adds the Unicode-3.0 license,
|
|
# which is not on the license allowlist, so the version is exact.
|
|
unicode-properties = { version = "=0.1.4", default-features = false, features = ["general-category"] }
|
|
# The seed of Math.random (interp.rs).
|
|
getrandom = "0.4"
|
|
|
|
[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dependencies]
|
|
# The browser's crypto.getRandomValues.
|
|
getrandom = { version = "0.4", features = ["wasm_js"] }
|
|
|
|
[dev-dependencies]
|
|
proptest = { workspace = true }
|