mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-24 18:32:23 +00:00
Script checker: setting a File's length, hidden or readonly counts as a file write
Setting a File object's length truncates or pads the file, and setting readonly or hidden changes it, but script.check reported no outside category for those assignments. It now reports file.write and filesWritten for them: plain and compound assignment, ++ and -- before or after, and the property name as a string literal in brackets. A new integration test lists every global and member the script host adds to the JavaScript engine (the own properties of the global object, of each object or function it holds and of each function's prototype, compared with a plain engine) and fails when one has no row. Each name that reaches outside the document has a probe script, and the test checks that script.check gives it the expected outside id. vc is listed as not checked: script.check reads scripts written for the reference app's scripting, and what vc.run does depends on the command. The test also checks that the checker lists every preprocessor directive the host reads, through the new DirectiveName::ALL. File object properties: https://extendscript.docsforadobe.dev/file-system-access/file-object/
This commit is contained in:
+4
-4
@@ -2556,10 +2556,10 @@ control character, in the first 8 KiB) or `tooLarge` (over 8 MiB). For a script,
|
||||
- `menuCommands.strings` lists the string literals the script passes to `executeMenuCommand`
|
||||
(`app.executeMenuCommand('…')`), each with a count and its lines, and `menuCommands.dynamic` counts the calls
|
||||
whose argument isn't a string literal.
|
||||
- `outside` lists what the script does outside the document: `filesWritten` (with the open modes used),
|
||||
`filesOpened` (files opened in other apps), `network`, `nativeCode`, `otherApps` (messages to other apps),
|
||||
`environment` (environment variables), `unseenCode` (`eval`, `new Function` and `$.evalFile`) and
|
||||
`preferences` (the reference app's preferences changed).
|
||||
- `outside` lists what the script does outside the document: `filesWritten` (with the open modes used; setting a
|
||||
File object's `length`, `hidden` or `readonly` counts too), `filesOpened` (files opened in other apps), `network`,
|
||||
`nativeCode`, `otherApps` (messages to other apps), `environment` (environment variables), `unseenCode` (`eval`,
|
||||
`new Function` and `$.evalFile`) and `preferences` (the reference app's preferences changed).
|
||||
- `problems` lists what would stop the script loading as written (strings, comments, regular expressions,
|
||||
template literals and XML literals that aren't closed, brackets that don't match, syntax newer than ES3 and
|
||||
unknown directives) and notes on its text (bytes that aren't valid UTF-8, mixed line endings, and nesting deeper
|
||||
|
||||
Reference in New Issue
Block a user