@@ -473,6 +473,28 @@ ES2015. Then the emitter pretty-prints the AST.
473
473
474
474
TODO: This leaves out module transformers.
475
475
476
+ ## Branded Types
477
+
478
+ Two branded types exist within the compiler, ` Path ` and ` __String ` . These
479
+ are both branded strings with different shapes and different purposes.
480
+
481
+ ` Path ` is used to represent an absolute, normalized, canonical folder path
482
+ or file name. If you have a ` Path ` , it should already be all of the above.
483
+ You may get a path from a path-looking string via ` toPath ` , and a ` Path ` may
484
+ be safely used anywhere a string is requested.
485
+
486
+ ` __String ` is used to represent a string whose leading underscore have been
487
+ escaped (if present) or a string representing an internal compiler symbol name,
488
+ such as ` "__call" ` . To escape a string in this way, call ` escapeLeadingUnderscores ` .
489
+ To unescape such a string, call ` unescapeLeadingUnderscores ` . Strings of this kind
490
+ are used to represent symbol names and identifier text, to allow for internal symbol
491
+ names to cohabitate the same symbol table as normal members without being in conflict.
492
+ The brand on this type is structured such that it is castable and comparable with
493
+ normal strings, but a normal string cannot be used in its place and it can not
494
+ be used in place of a normal string (to prevent escaped text from leaking out via
495
+ diagnostic messages and the like). The union member enabling this is the member intersected
496
+ with ` void ` , which makes it incompatible with anything asking for a string.
497
+
476
498
## Services
477
499
478
500
I don't know anything about services. And besides, this readme is for
0 commit comments