mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-28 09:21:55 +01:00
Assigning a DocumentPreset setting stored any value until the run ended, and the value was checked only when addDocument read it. A script could keep gigabytes of strings in presets that no addDocument would accept. The setter now checks the value before storing it: a value of the setting's enumeration, a finite number, a title of at most 4096 bytes, true or false for documentBleedLink, or four finite numbers for documentBleedOffsetRect. undefined unsets any setting, and the three settings addDocument does not apply yet also take null. A value of another kind throws a TypeError, a longer title throws a RangeError, and the setting keeps its old value. addDocument still checks the ranges.