Repository navigation
Commit a367ecc
committed
š Hand a value body down the call stack, where a document cannot reach it
The named-context attack was fixed by sealing the carrier, but the capability
was still exported: an eval block's imports are hoisted and resolved like any
module's, so a document could import `claimReturn` and `selectReturnValue` from
this package's own source by file URL, read the real carrier out of
`createContext("expand.return")`, and call the engine's helpers with the
engine's carrier. A value root declaring `returns: { type: number }` published
"schema-bypassed" at exit 0 without executing its authored <Return>.
Sealing the carrier harder cannot fix that, because the two capabilities compose:
anything published contextually is readable, and any exported function acting on
what was published is callable. So selection now uses neither. A `ReturnBody` is
a plain object whose claim, selection and settlement are closures over state
nothing else holds, and it reaches the `<Return>` that claims it as an ordinary
parameter of expansion ā down the call stack, which document code cannot read or
replace.
Ownership is unchanged and now explicit at every site rather than ambient: a
component invocation passes none, caller projection passes the caller's,
dynamically scanned markdown and generated fragments pass none, and the two
owners settle from the object their own expansion created and held as a local.
`ActiveReturn` is gone; nothing exported takes another body's.
RV10e gains the direct-import case: a document imports this module by file URL,
uses every export it still has, and reaches for the old context. The run fails
with the existing missing-return diagnostic, publishes nothing, and the
schema-invalid string never reaches the caller.
Refs #6401 parent 9a28c95 commit a367ecc
5 files changed
Lines changed: 179 additions & 202 deletions
File tree
- packages/core
- src
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
| 85 | + | |
91 | 86 | | |
92 | 87 | | |
93 | 88 | | |
| |||
1600 | 1595 | | |
1601 | 1596 | | |
1602 | 1597 | | |
1603 | | - | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
1604 | 1601 | | |
1605 | 1602 | | |
1606 | 1603 | | |
| |||
1612 | 1609 | | |
1613 | 1610 | | |
1614 | 1611 | | |
1615 | | - | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
1620 | 1612 | | |
1621 | 1613 | | |
1622 | 1614 | | |
| |||
1629 | 1621 | | |
1630 | 1622 | | |
1631 | 1623 | | |
| 1624 | + | |
1632 | 1625 | | |
1633 | 1626 | | |
1634 | 1627 | | |
| |||
1642 | 1635 | | |
1643 | 1636 | | |
1644 | 1637 | | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
| 1638 | + | |
1648 | 1639 | | |
1649 | 1640 | | |
1650 | 1641 | | |
| |||
1785 | 1776 | | |
1786 | 1777 | | |
1787 | 1778 | | |
| 1779 | + | |
1788 | 1780 | | |
1789 | 1781 | | |
1790 | 1782 | | |
| |||
1811 | 1803 | | |
1812 | 1804 | | |
1813 | 1805 | | |
| 1806 | + | |
1814 | 1807 | | |
1815 | 1808 | | |
1816 | 1809 | | |
| |||
0 commit comments