jsilnet 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +98 -3
- package/REFERENCE.md +191 -0
- package/dist/browser/index.js +345 -0
- package/dist/browser/worker.js +42480 -0
- package/example/README.md +22 -0
- package/example/Sample.cs +10 -0
- package/example/Sample.csproj +7 -0
- package/example/edit-constant.js +48 -0
- package/example/inspect.js +37 -0
- package/package.json +61 -6
- package/src/assembly/instruction-editing.js +165 -0
- package/src/assembly/method-removal.js +789 -0
- package/src/assembly/pointer-table-editing.js +506 -0
- package/src/assembly/portable-pdb-editing.js +441 -0
- package/src/binary/errors.js +17 -0
- package/src/binary/reader.js +206 -0
- package/src/browser/index.d.ts +123 -0
- package/src/browser/index.js +373 -0
- package/src/browser/worker-runtime.js +287 -0
- package/src/browser/worker.js +47 -0
- package/src/il/body.js +165 -0
- package/src/il/instructions.js +217 -0
- package/src/il/opcodes.js +102 -0
- package/src/il/rewrite.js +331 -0
- package/src/index.d.ts +267 -0
- package/src/index.js +13307 -0
- package/src/metadata/classic-pdb.js +2530 -0
- package/src/metadata/custom-attributes.js +387 -0
- package/src/metadata/portable-pdb.js +3347 -0
- package/src/metadata/resources.js +37 -0
- package/src/metadata/root-writer.js +54 -0
- package/src/metadata/signatures.js +339 -0
- package/src/metadata/streams.js +285 -0
- package/src/metadata/strong-name.js +230 -0
- package/src/metadata/tables.js +390 -0
- package/src/metadata/writer.js +191 -0
- package/src/pe/headers.js +491 -0
- package/src/platform/bytes.js +21 -0
- package/src/platform/compression.js +24 -0
- package/src/platform/crypto.js +17 -0
- package/src/resolution/module.js +64 -0
- package/src/types/assembly/instruction-editing.d.ts +33 -0
- package/src/types/assembly/method-removal.d.ts +3 -0
- package/src/types/assembly/pointer-table-editing.d.ts +3 -0
- package/src/types/assembly/portable-pdb-editing.d.ts +23 -0
- package/src/types/binary/errors.d.ts +7 -0
- package/src/types/binary/reader.d.ts +30 -0
- package/src/types/il/body.d.ts +51 -0
- package/src/types/il/instructions.d.ts +33 -0
- package/src/types/il/opcodes.d.ts +2 -0
- package/src/types/il/rewrite.d.ts +38 -0
- package/src/types/index.d.ts +864 -0
- package/src/types/metadata/classic-pdb.d.ts +688 -0
- package/src/types/metadata/custom-attributes.d.ts +28 -0
- package/src/types/metadata/portable-pdb.d.ts +296 -0
- package/src/types/metadata/resources.d.ts +1 -0
- package/src/types/metadata/root-writer.d.ts +1 -0
- package/src/types/metadata/signatures.d.ts +5 -0
- package/src/types/metadata/streams.d.ts +26 -0
- package/src/types/metadata/strong-name.d.ts +11 -0
- package/src/types/metadata/tables.d.ts +25 -0
- package/src/types/metadata/writer.d.ts +16 -0
- package/src/types/pe/headers.d.ts +160 -0
- package/src/types/platform/bytes.d.ts +3 -0
- package/src/types/platform/compression.d.ts +2 -0
- package/src/types/platform/crypto.d.ts +4 -0
- package/src/types/resolution/module.d.ts +12 -0
- package/src/types/writer/patch.d.ts +4 -0
- package/src/types/writer/pe.d.ts +9 -0
- package/src/types/writer/structural.d.ts +4 -0
- package/src/writer/patch.js +42 -0
- package/src/writer/pe.js +196 -0
- package/src/writer/structural.js +241 -0
|
@@ -0,0 +1,506 @@
|
|
|
1
|
+
import { FormatError, UnsupportedFormatError } from "../binary/errors.js";
|
|
2
|
+
import { parseSignature } from "../metadata/signatures.js";
|
|
3
|
+
import { metadataTableId, metadataTableNames } from "../metadata/tables.js";
|
|
4
|
+
|
|
5
|
+
export function createPointerTableEditor(hooks) {
|
|
6
|
+
const {
|
|
7
|
+
getBijectivePointerRows,
|
|
8
|
+
validateGenericVariableReferences,
|
|
9
|
+
getGenericParameterArity,
|
|
10
|
+
validateTypeSpecDefinitions,
|
|
11
|
+
validateTypeSpecGenericContext
|
|
12
|
+
} = hooks;
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
reorderPointerTable(pointerTable, targetRids) {
|
|
16
|
+
hooks.ensureEditable();
|
|
17
|
+
|
|
18
|
+
const pointerTableId = metadataTableId(pointerTable);
|
|
19
|
+
|
|
20
|
+
const definitions = new Map([
|
|
21
|
+
|
|
22
|
+
[3, { targetTableId: 4, column: "Field", owners: this.types, list: "fieldRids", records: "fields" }],
|
|
23
|
+
|
|
24
|
+
[5, { targetTableId: 6, column: "Method", owners: this.types, list: "methodRids", records: "methods" }],
|
|
25
|
+
|
|
26
|
+
[7, {
|
|
27
|
+
|
|
28
|
+
targetTableId: 8,
|
|
29
|
+
|
|
30
|
+
column: "Param",
|
|
31
|
+
|
|
32
|
+
owners: this.methods,
|
|
33
|
+
|
|
34
|
+
list: "parameterRids",
|
|
35
|
+
|
|
36
|
+
records: "parameters"
|
|
37
|
+
|
|
38
|
+
}],
|
|
39
|
+
|
|
40
|
+
[19, { targetTableId: 20, column: "Event", owners: this.types, list: "eventRids", records: "events" }],
|
|
41
|
+
|
|
42
|
+
[22, {
|
|
43
|
+
|
|
44
|
+
targetTableId: 23,
|
|
45
|
+
|
|
46
|
+
column: "Property",
|
|
47
|
+
|
|
48
|
+
owners: this.types,
|
|
49
|
+
|
|
50
|
+
list: "propertyRids",
|
|
51
|
+
|
|
52
|
+
records: "properties"
|
|
53
|
+
|
|
54
|
+
}]
|
|
55
|
+
|
|
56
|
+
]);
|
|
57
|
+
|
|
58
|
+
const definition = definitions.get(pointerTableId);
|
|
59
|
+
|
|
60
|
+
if (!definition) {
|
|
61
|
+
|
|
62
|
+
throw new TypeError("Pointer table must be FieldPtr, MethodPtr, ParamPtr, EventPtr, or PropertyPtr");
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const allowsCrossOwnerFields = pointerTableId === 3;
|
|
67
|
+
|
|
68
|
+
const allowsCrossOwnerMethods = pointerTableId === 5;
|
|
69
|
+
|
|
70
|
+
const allowsCrossOwnerParameters = pointerTableId === 7;
|
|
71
|
+
|
|
72
|
+
const allowsCrossOwnerEvents = pointerTableId === 19;
|
|
73
|
+
|
|
74
|
+
const allowsCrossOwnerProperties = pointerTableId === 22;
|
|
75
|
+
|
|
76
|
+
if ((this.tables.valid & (1n << BigInt(pointerTableId))) === 0n) {
|
|
77
|
+
|
|
78
|
+
throw new UnsupportedFormatError(`${metadataTableNames[pointerTableId]} is not present`);
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
const pointerRows = getBijectivePointerRows(
|
|
83
|
+
|
|
84
|
+
this,
|
|
85
|
+
|
|
86
|
+
pointerTableId,
|
|
87
|
+
|
|
88
|
+
definition.targetTableId,
|
|
89
|
+
|
|
90
|
+
definition.column
|
|
91
|
+
|
|
92
|
+
);
|
|
93
|
+
|
|
94
|
+
if (!pointerRows) {
|
|
95
|
+
|
|
96
|
+
throw new FormatError(
|
|
97
|
+
|
|
98
|
+
`${metadataTableNames[pointerTableId]} must be a one-to-one mapping to ${metadataTableNames[definition.targetTableId]}`
|
|
99
|
+
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const targetCount = this.tables.counts[definition.targetTableId] ?? 0;
|
|
105
|
+
|
|
106
|
+
if (!Array.isArray(targetRids) || targetRids.length !== targetCount) {
|
|
107
|
+
|
|
108
|
+
throw new RangeError("Pointer table order must contain every target row exactly once");
|
|
109
|
+
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const newRids = [...targetRids];
|
|
113
|
+
|
|
114
|
+
const uniqueRids = new Set(newRids);
|
|
115
|
+
|
|
116
|
+
if (uniqueRids.size !== targetCount ||
|
|
117
|
+
|
|
118
|
+
newRids.some((rid) => !Number.isInteger(rid) || rid < 1 || rid > targetCount)) {
|
|
119
|
+
|
|
120
|
+
throw new RangeError("Pointer table order must contain every target row exactly once");
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const ownerGroups = definition.owners.map((owner) => owner[definition.list]);
|
|
125
|
+
|
|
126
|
+
const currentOwnerRids = ownerGroups.flat();
|
|
127
|
+
|
|
128
|
+
if (currentOwnerRids.length !== targetCount ||
|
|
129
|
+
|
|
130
|
+
new Set(currentOwnerRids).size !== targetCount) {
|
|
131
|
+
|
|
132
|
+
throw new FormatError(
|
|
133
|
+
|
|
134
|
+
`${metadataTableNames[definition.targetTableId]} ownership does not cover every row exactly once`
|
|
135
|
+
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const currentOwnerByRid = new Map();
|
|
141
|
+
|
|
142
|
+
for (let index = 0; index < ownerGroups.length; index++) {
|
|
143
|
+
|
|
144
|
+
for (const rid of ownerGroups[index]) {
|
|
145
|
+
|
|
146
|
+
currentOwnerByRid.set(rid, definition.owners[index].rid);
|
|
147
|
+
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const assignments = [];
|
|
153
|
+
|
|
154
|
+
let offset = 0;
|
|
155
|
+
|
|
156
|
+
const recordsByRid = new Map(
|
|
157
|
+
|
|
158
|
+
definition.owners.flatMap((owner) =>
|
|
159
|
+
|
|
160
|
+
owner[definition.records].map((record) => [record.rid, record])
|
|
161
|
+
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
for (let index = 0; index < definition.owners.length; index++) {
|
|
167
|
+
|
|
168
|
+
const owner = definition.owners[index];
|
|
169
|
+
|
|
170
|
+
const oldGroup = ownerGroups[index];
|
|
171
|
+
|
|
172
|
+
const nextGroup = newRids.slice(offset, offset + oldGroup.length);
|
|
173
|
+
|
|
174
|
+
offset += oldGroup.length;
|
|
175
|
+
|
|
176
|
+
const oldSet = new Set(oldGroup);
|
|
177
|
+
|
|
178
|
+
const movesRowsAcrossOwners = nextGroup.some((rid) => !oldSet.has(rid));
|
|
179
|
+
|
|
180
|
+
const allowsCrossOwnerRows = allowsCrossOwnerFields || allowsCrossOwnerMethods ||
|
|
181
|
+
|
|
182
|
+
allowsCrossOwnerParameters || allowsCrossOwnerEvents || allowsCrossOwnerProperties;
|
|
183
|
+
|
|
184
|
+
if (!allowsCrossOwnerRows && movesRowsAcrossOwners) {
|
|
185
|
+
|
|
186
|
+
throw new UnsupportedFormatError("Pointer reordering cannot change row ownership");
|
|
187
|
+
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
const nextRecords = nextGroup.map((rid) => recordsByRid.get(rid));
|
|
191
|
+
|
|
192
|
+
if (nextRecords.some((record) => !record)) {
|
|
193
|
+
|
|
194
|
+
throw new FormatError(`${metadataTableNames[definition.targetTableId]} ownership has no semantic record`);
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
const movedRecords = nextRecords.filter((record) =>
|
|
199
|
+
|
|
200
|
+
currentOwnerByRid.get(record.rid) !== owner.rid
|
|
201
|
+
|
|
202
|
+
);
|
|
203
|
+
|
|
204
|
+
if (allowsCrossOwnerFields) {
|
|
205
|
+
|
|
206
|
+
for (const record of movedRecords) {
|
|
207
|
+
|
|
208
|
+
const parsed = parseSignature(record.signature, { counts: this.tables.counts });
|
|
209
|
+
|
|
210
|
+
if (parsed.kind !== "field") {
|
|
211
|
+
|
|
212
|
+
throw new FormatError(`Field row ${record.rid} has a non-field signature`);
|
|
213
|
+
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
validateGenericVariableReferences(
|
|
217
|
+
|
|
218
|
+
parsed,
|
|
219
|
+
|
|
220
|
+
getGenericParameterArity(this.genericParams, 2, owner.rid),
|
|
221
|
+
|
|
222
|
+
this
|
|
223
|
+
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
if ((this.tables.rows.get(16) ?? []).some((layout) =>
|
|
227
|
+
|
|
228
|
+
layout.Field.rid === record.rid
|
|
229
|
+
|
|
230
|
+
) && (owner.flags & 0x0018) !== 0x0010) {
|
|
231
|
+
|
|
232
|
+
throw new UnsupportedFormatError(
|
|
233
|
+
|
|
234
|
+
`Field row ${record.rid} has an explicit offset and requires an explicit-layout owner`
|
|
235
|
+
|
|
236
|
+
);
|
|
237
|
+
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (allowsCrossOwnerParameters && movesRowsAcrossOwners) {
|
|
245
|
+
|
|
246
|
+
const signature = parseSignature(owner.signature, { counts: this.tables.counts });
|
|
247
|
+
|
|
248
|
+
if (signature.kind !== "method") {
|
|
249
|
+
|
|
250
|
+
throw new FormatError(`MethodDef row ${owner.rid} has a non-method signature`);
|
|
251
|
+
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
const sequences = new Set();
|
|
255
|
+
|
|
256
|
+
for (const record of nextRecords) {
|
|
257
|
+
|
|
258
|
+
if (!Number.isInteger(record.sequence) || record.sequence < 0 ||
|
|
259
|
+
|
|
260
|
+
record.sequence > signature.parameters.length) {
|
|
261
|
+
|
|
262
|
+
throw new FormatError(
|
|
263
|
+
|
|
264
|
+
`Param row ${record.rid} sequence exceeds MethodDef row ${owner.rid}'s signature`
|
|
265
|
+
|
|
266
|
+
);
|
|
267
|
+
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if (sequences.has(record.sequence)) {
|
|
271
|
+
|
|
272
|
+
throw new FormatError(
|
|
273
|
+
|
|
274
|
+
`MethodDef row ${owner.rid} would have duplicate Param sequence ${record.sequence}`
|
|
275
|
+
|
|
276
|
+
);
|
|
277
|
+
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
sequences.add(record.sequence);
|
|
281
|
+
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (allowsCrossOwnerMethods && movesRowsAcrossOwners) {
|
|
287
|
+
|
|
288
|
+
if ((owner.flags & (0x0080 | 0x0020)) === 0) {
|
|
289
|
+
|
|
290
|
+
throw new UnsupportedFormatError(
|
|
291
|
+
|
|
292
|
+
"Pointer reordering cannot move abstract methods to a non-abstract TypeDef"
|
|
293
|
+
|
|
294
|
+
);
|
|
295
|
+
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
for (const record of movedRecords) {
|
|
299
|
+
|
|
300
|
+
if (record.rva !== 0 || (record.flags & 0x0440) !== 0x0440 ||
|
|
301
|
+
|
|
302
|
+
record.genericParams.length > 0) {
|
|
303
|
+
|
|
304
|
+
throw new UnsupportedFormatError(
|
|
305
|
+
|
|
306
|
+
"Cross-owner MethodPtr reordering supports only bodyless, non-generic abstract virtual methods"
|
|
307
|
+
|
|
308
|
+
);
|
|
309
|
+
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
const signature = parseSignature(record.signature, { counts: this.tables.counts });
|
|
313
|
+
|
|
314
|
+
if (signature.kind !== "method") {
|
|
315
|
+
|
|
316
|
+
throw new FormatError(`MethodDef row ${record.rid} has a non-method signature`);
|
|
317
|
+
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
if ((signature.genericParameterCount ?? 0) > 0) {
|
|
321
|
+
|
|
322
|
+
throw new UnsupportedFormatError(
|
|
323
|
+
|
|
324
|
+
"Cross-owner MethodPtr reordering does not support generic methods"
|
|
325
|
+
|
|
326
|
+
);
|
|
327
|
+
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
validateGenericVariableReferences(
|
|
331
|
+
|
|
332
|
+
signature,
|
|
333
|
+
|
|
334
|
+
getGenericParameterArity(this.genericParams, 2, owner.rid),
|
|
335
|
+
|
|
336
|
+
this,
|
|
337
|
+
|
|
338
|
+
null,
|
|
339
|
+
|
|
340
|
+
signature.genericParameterCount ?? 0
|
|
341
|
+
|
|
342
|
+
);
|
|
343
|
+
|
|
344
|
+
const hasMethodSemantics = (this.tables.rows.get(24) ?? []).some((row) =>
|
|
345
|
+
|
|
346
|
+
row.Method.rid === record.rid
|
|
347
|
+
|
|
348
|
+
);
|
|
349
|
+
|
|
350
|
+
const hasMethodImpl = (this.tables.rows.get(25) ?? []).some((row) =>
|
|
351
|
+
|
|
352
|
+
row.MethodBody.target?.table === 6 && row.MethodBody.target.rid === record.rid ||
|
|
353
|
+
|
|
354
|
+
row.MethodDeclaration.target?.table === 6 && row.MethodDeclaration.target.rid === record.rid
|
|
355
|
+
|
|
356
|
+
);
|
|
357
|
+
|
|
358
|
+
if (hasMethodSemantics || hasMethodImpl) {
|
|
359
|
+
|
|
360
|
+
throw new UnsupportedFormatError(
|
|
361
|
+
|
|
362
|
+
"Pointer reordering cannot change row ownership for methods with semantics or MethodImpl rows"
|
|
363
|
+
|
|
364
|
+
);
|
|
365
|
+
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if (allowsCrossOwnerEvents && movesRowsAcrossOwners) {
|
|
373
|
+
|
|
374
|
+
for (const record of movedRecords) {
|
|
375
|
+
|
|
376
|
+
const hasSemantics = (this.tables.rows.get(24) ?? []).some((row) =>
|
|
377
|
+
|
|
378
|
+
row.Association.target?.table === 20 && row.Association.target.rid === record.rid
|
|
379
|
+
|
|
380
|
+
);
|
|
381
|
+
|
|
382
|
+
if (hasSemantics) {
|
|
383
|
+
|
|
384
|
+
throw new UnsupportedFormatError(
|
|
385
|
+
|
|
386
|
+
"Pointer reordering cannot change row ownership for events with MethodSemantics rows"
|
|
387
|
+
|
|
388
|
+
);
|
|
389
|
+
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if (record.eventType.table === 27) {
|
|
393
|
+
|
|
394
|
+
const typeArity = getGenericParameterArity(this.genericParams, 2, owner.rid);
|
|
395
|
+
|
|
396
|
+
const typeSpec = this.typeSpecs[record.eventType.rid - 1];
|
|
397
|
+
|
|
398
|
+
if (!typeSpec) {
|
|
399
|
+
|
|
400
|
+
throw new FormatError(`Event row ${record.rid} references missing TypeSpec row ${record.eventType.rid}`);
|
|
401
|
+
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
validateTypeSpecDefinitions(this, typeSpec.parsedSignature);
|
|
405
|
+
|
|
406
|
+
validateTypeSpecGenericContext(this, record.eventType.rid, typeArity);
|
|
407
|
+
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
if (allowsCrossOwnerProperties && movesRowsAcrossOwners) {
|
|
415
|
+
|
|
416
|
+
for (const record of movedRecords) {
|
|
417
|
+
|
|
418
|
+
const hasSemantics = (this.tables.rows.get(24) ?? []).some((row) =>
|
|
419
|
+
|
|
420
|
+
row.Association.target?.table === 23 && row.Association.target.rid === record.rid
|
|
421
|
+
|
|
422
|
+
);
|
|
423
|
+
|
|
424
|
+
if (hasSemantics) {
|
|
425
|
+
|
|
426
|
+
throw new UnsupportedFormatError(
|
|
427
|
+
|
|
428
|
+
"Pointer reordering cannot change row ownership for properties with MethodSemantics rows"
|
|
429
|
+
|
|
430
|
+
);
|
|
431
|
+
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
const signature = parseSignature(record.signature, { counts: this.tables.counts });
|
|
435
|
+
|
|
436
|
+
if (signature.kind !== "property") {
|
|
437
|
+
|
|
438
|
+
throw new FormatError(`Property row ${record.rid} has a non-property signature`);
|
|
439
|
+
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
validateGenericVariableReferences(
|
|
443
|
+
|
|
444
|
+
signature,
|
|
445
|
+
|
|
446
|
+
getGenericParameterArity(this.genericParams, 2, owner.rid),
|
|
447
|
+
|
|
448
|
+
this
|
|
449
|
+
|
|
450
|
+
);
|
|
451
|
+
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
assignments.push({ owner, nextGroup, nextRecords });
|
|
457
|
+
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
if (offset !== targetCount) {
|
|
461
|
+
|
|
462
|
+
throw new FormatError(
|
|
463
|
+
|
|
464
|
+
`${metadataTableNames[definition.targetTableId]} ownership does not cover every row exactly once`
|
|
465
|
+
|
|
466
|
+
);
|
|
467
|
+
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
const nextPointerRows = newRids.map((rid, index) => ({
|
|
471
|
+
|
|
472
|
+
...pointerRows[index],
|
|
473
|
+
|
|
474
|
+
rid: index + 1,
|
|
475
|
+
|
|
476
|
+
[definition.column]: {
|
|
477
|
+
|
|
478
|
+
raw: rid,
|
|
479
|
+
|
|
480
|
+
table: definition.targetTableId,
|
|
481
|
+
|
|
482
|
+
tableName: metadataTableNames[definition.targetTableId],
|
|
483
|
+
|
|
484
|
+
rid
|
|
485
|
+
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
}));
|
|
489
|
+
|
|
490
|
+
this.tables.rows.set(pointerTableId, nextPointerRows);
|
|
491
|
+
|
|
492
|
+
for (const assignment of assignments) {
|
|
493
|
+
|
|
494
|
+
assignment.owner[definition.list] = assignment.nextGroup;
|
|
495
|
+
|
|
496
|
+
assignment.owner[definition.records] = assignment.nextRecords;
|
|
497
|
+
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
this._metadataDirty = true;
|
|
501
|
+
|
|
502
|
+
return this;
|
|
503
|
+
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
}
|