mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-30 02:07:10 +01:00
Docs: limit numeric collection names to JavaScript's own number text
A key such as "1.50" is a plain name and throws Not found when nothing has it; only keys written as JavaScript writes the number, such as "1.5", give undefined.
This commit is contained in:
1 parent
12b00a4a37
commit
1e5aec6296
1 file changed
+2
-1
+2
-1
@@ -2867,7 +2867,8 @@ other files through `$`:
|
||||
`Not found`; `"name" in pageItems` is false then, and assigning to such a name throws `Not found` too
|
||||
(VectorCraft's own rule). A read with the text of a number that is not an array index, such as
|
||||
`pageItems["-1"]`, `pageItems[1.5]` or `documents["NaN"]`, looks for an object of that name and gives `undefined`
|
||||
when nothing has it, and `"-1" in pageItems` is true when an object has that name; `index(key)` takes a number as
|
||||
when nothing has it. This applies only to the text JavaScript writes for that number: `pageItems["1.50"]` is a
|
||||
plain name and throws `Not found` when nothing has it. `"-1" in pageItems` is true when an object has that name; `index(key)` takes a number as
|
||||
a position only (VectorCraft's own rule). `JSON.stringify` does not read `toJSON` from a collection this way. `name` and `note`
|
||||
take a number or a Boolean as the text `String(value)` gives. `String(object)` gives
|
||||
`[PathItem Logo]` for a page item named `Logo` (`[PathItem ]` with no name), `[Document <name>]`,
|
||||
|
||||
Reference in new issue
Block a user