- A string in `0b` or `0o` form converts to a number in a realm with
`Options::es2015`, so an array iterator over an object whose length
is "0b10" visits two elements. Realms without the option still read
such strings as NaN.
- `JSON.stringify` calls a String or Number object's `@@toPrimitive`
method before using its stored value, for the value itself, a
replacer list entry and the `space` argument.
- A host function that returns a Symbol in a realm without the option
throws a `TypeError`. A Symbol's description is charged to the heap
before it is built.
- A text function takes a Symbol as `String(symbol)` gives it, and a
data function refuses an object or array with an enumerable
Symbol-keyed property; checking the keys takes fuel.
- A Symbol-keyed lookup takes a unit of fuel for each prototype it
passes, and removing most of an object's Symbol keys releases their
storage.
With Options::es2015 set, a vectorcraft-js realm has Symbol (ECMA-262
11th edition, section 19.4): Symbol(description), which new refuses,
the description getter, toString, valueOf, and Symbol.for and
Symbol.keyFor over a registry that lasts as long as the realm. typeof
gives "symbol". Symbols are property keys: Object.getOwnPropertySymbols
lists them in the order they were added, defineProperty,
getOwnPropertyDescriptor, freeze, seal, in, delete and hasOwnProperty
take them, and for-in, Object.keys, getOwnPropertyNames and
JSON.stringify leave them out. String(symbol) and symbol.toString()
give Symbol(description); any other conversion of a Symbol to a string
or a number throws a TypeError.
Symbol.iterator, asyncIterator, hasInstance, toPrimitive and
toStringTag are defined. Conversion to a primitive calls @@toPrimitive,
instanceof calls @@hasInstance, and Object.prototype.toString writes a
string @@toStringTag. Array.prototype.values (also @@iterator), keys
and entries, String.prototype[@@iterator] (by code point) and every
arguments object's @@iterator return iterators with next(). An Array
Iterator's next keeps its object reachable while a length getter or
valueOf runs script.
Each iterator step takes fuel, and each Symbol and registry entry
counts against the heap limit. An error about a Symbol-keyed property
names the Symbol by at most 256 units of its description, built only
when the error is thrown. String(symbol), symbol.toString() and the
[object tag] of Object.prototype.toString charge their copies to the
heap and fuel first. Realms without the option, including the one the
app runs scripts in, are unchanged. for-of, spread and destructuring
are not part of this change.
cargo xtask test262 runs the suite's Symbol, ArrayIteratorPrototype,
StringIteratorPrototype, getOwnPropertySymbols, Array.prototype
values/keys/entries/Symbol.iterator and String.prototype[Symbol.iterator]
tests in such a realm: 164 of 216 runs pass (6 before). The 52 others
expect a configurable function length and a function name property.
A color a library pattern's art brings now skips the library's numbered
names while the pattern is imported, instead of being renamed after the
import. The rename also rewrote every other paint in the document linked
to the name the import first gave, such as art still linked to a deleted
"Ink 2", so adding the pattern changed that art. Now the names are held
with placeholder swatches during the import and removed afterwards, and
links that were already in the document stay as they were.
A pattern whose art brings both "Ink" and the library's "Ink 2" keeps the
library's "Ink 2" under its own name when the document gives "Ink"
another color, and the library's "Ink" takes the next free name. A library
pattern with a numbered name, such as "Tiles 2", keeps that name when the
document does not use it.
A global or spot color that a library pattern's art brings under a
numbered name no longer takes a name the library gives another swatch.
Before, adding a pattern whose art uses "Ink" to a document with another
"Ink" brought the color as "Ink 2" even when the library has its own
"Ink 2"; adding that library swatch next then came in as "Ink 2 2". The
brought color now takes the next free name the library does not use
("Ink 3"), and every paint linked to it follows the new name, so adding
the library's "Ink 2" next adds it under its own name and adding both
again adds nothing.
A color the pattern's art brings or takes is the color a library tint
or gradient links to only when it has the library color's paint and its
process, global or spot kind, as for the other lookups in the same add.
The test a_numbered_copy_named_like_another_library_color_is_found now
makes the blue "Ink 2" itself, as an earlier version's pattern add left
it, since a pattern add no longer gives that name.
A press keeps the pointer and the snapped point for the end of the piece it adds. When Alt
changes the action during the press, the end goes through the protractor's tick again for the
new action, so a continuous arc that snapped to a tick and becomes a sharp-corner arc ends at the
pointer, and a piece that becomes a continuous arc goes onto the tick, without waiting for the
next drag. This also covers a press that has not dragged.
A continuous arc that starts a path has no direction to follow and
sweeps the arc size, as a sharp-corner arc does. Moving its end onto a
protractor tick put the end on a circle the drawn arc does not follow,
so `tick_end` now gives no tick for it.
The hover keeps the snap settings it was made with (`SnapSettings` in
guides/snap.rs: the window, zoom, snapping options, tolerances,
Alignment Guides and construction angles). After one of them changes
under a still pointer, the hover's rubber band, protractor, distance
label and Smart Guides are hidden until the pointer moves, also through
a press, so the preview shows no point that a click would not place.
A press also drops the hover, so after a click puts an arc's end on a
tick no preview runs from that end back to the pointer. While the
pointer hovers, the tool asks the canvas to hover it again when the
view, the document or the selection changes (`wants_rehover`).
* svg: cut over CSS transform, CSS string quoting, and symbol unit basis to craft-svg (#789)
* build: repin craft-svg to merged craft-libs main (d20a8248)