Repository navigation
Commit 4e757c8
fix(render,verify): close six divergences review found in the has-accessor change
Code review over the branch found that the change meant to END a cross-port
divergence had introduced four of its own, plus two verify defects. Fixing them is
the point; the lesson is that "one shared rule" written four times in four
languages is still four implementations.
A LIVE REGRESSION, worst first. TS rebuilt ANY non-array object from
Object.entries(), so anything carrying its own prototype was flattened: a Date
rendered as "[object Object]" and a class instance lost its getters. Confirmed by
running it. Now only PLAIN objects are rebuilt (prototype is Object.prototype or
null), which is also what the other ports do.
THE FOUR PORTS DID NOT AGREE:
- C# an IDictionary is IEnumerable, so it matched the collection arm and an
empty nested object reported ABSENT where every other port says present.
Dictionary is now matched first.
- Java recursion covered Map/List only, so Set elements and array elements got no
accessors -- contradicting the method's own javadoc; and an empty primitive
array reported PRESENT because Object[] does not match int[]. Now every
Collection recurses, arrays recurse by reflection, and length is read with
Array.getLength.
- Py the numeric skip listed int/float/complex, missing Decimal and Fraction,
so Python injected hasPrice where Java and C# inject nothing. Now
numbers.Number.
TWO VERIFY DEFECTS:
- The unclassified-file fail-open downgraded a broken @Verifiedby claim to a
warning if the name appeared ANYWHERE in production source -- including the
mountCrudRoutes case this file's own header cites as why the comment-only check
exists. The downgrade now requires the file to look like a test by LOCATION or
by CONTENT; production source with a matching name satisfies neither and stays
a hard error.
- The bare-name fallback for non-object claims reached into any package where the
name was unique. resolveObjectRef's own bare fallback is root-level only; this
now matches it.
GATED, not just fixed. The shared conformance fixture gains the empty-nested-object
case that catches the C# arm, so all five ports pin it rather than three agreeing by
luck. TS gains four regression tests (Date renders as a Date, class getters survive,
a Date-valued field still derives, nested plain objects still derive).
Verified after: TS render 327, cli 20 targeted; C# 291; Python 257; JVM render green
(snapshot regenerated for the extended fixture).
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 6c06603 commit 4e757c8
11 files changed
Lines changed: 98 additions & 14 deletions
File tree
- fixtures/render-conformance/render-derived-has-accessor
- server
- csharp/MetaObjects.Render
- java/render/src
- main/java/com/metaobjects/render
- test/resources/snapshots
- python/src/metaobjects/render
- typescript/packages
- cli/src/lib
- render
- src
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
7 | 16 | | |
8 | 17 | | |
9 | | - | |
10 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
66 | 69 | | |
67 | 70 | | |
68 | 71 | | |
| |||
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
104 | | - | |
105 | | - | |
106 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
107 | 118 | | |
108 | 119 | | |
109 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | | - | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
186 | 200 | | |
187 | 201 | | |
188 | 202 | | |
| |||
192 | 206 | | |
193 | 207 | | |
194 | 208 | | |
195 | | - | |
| 209 | + | |
196 | 210 | | |
197 | 211 | | |
198 | 212 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
0 commit comments