@typeberry/jam 0.1.2-b7cae5d → 0.1.2-dd9b0e2
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/block-generator/index.js +18 -6
- package/block-generator/index.js.map +1 -1
- package/importer/index.js +18 -6
- package/importer/index.js.map +1 -1
- package/index.js +18 -6
- package/index.js.map +1 -1
- package/jam-network/index.js +2 -2
- package/jam-network/index.js.map +1 -1
- package/package.json +1 -1
package/importer/index.js
CHANGED
|
@@ -13413,8 +13413,8 @@ function print(level, levelAndName, strings, data) {
|
|
|
13413
13413
|
return;
|
|
13414
13414
|
}
|
|
13415
13415
|
const lvlText = Level[level].padEnd(5);
|
|
13416
|
-
const val = strings.map((v, idx) => `${v}${data[idx]}`);
|
|
13417
|
-
const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
|
|
13416
|
+
const val = strings.map((v, idx) => `${v}${idx < data.length ? data[idx] : ""}`);
|
|
13417
|
+
const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
|
|
13418
13418
|
if (level === Level.WARN) {
|
|
13419
13419
|
console.warn(msg);
|
|
13420
13420
|
}
|
|
@@ -15939,6 +15939,17 @@ class PageRange {
|
|
|
15939
15939
|
}
|
|
15940
15940
|
return new PageRange(start, length);
|
|
15941
15941
|
}
|
|
15942
|
+
/** Returns true if the page range is wrapped (`start` >= `end`) and is not empty */
|
|
15943
|
+
isWrapped() {
|
|
15944
|
+
return this.start >= this.end && !this.isEmpty();
|
|
15945
|
+
}
|
|
15946
|
+
/** Checks if given page number is within the range */
|
|
15947
|
+
isInRange(page) {
|
|
15948
|
+
if (this.isWrapped()) {
|
|
15949
|
+
return page >= this.start || page < this.end;
|
|
15950
|
+
}
|
|
15951
|
+
return page >= this.start && page < this.end;
|
|
15952
|
+
}
|
|
15942
15953
|
/** Checks if a range is empty (`length === 0`) */
|
|
15943
15954
|
isEmpty() {
|
|
15944
15955
|
return this.length === 0;
|
|
@@ -16318,10 +16329,11 @@ class MemoryBuilder {
|
|
|
16318
16329
|
startHeapIndex (${startHeapIndex}) has to be less than or equal to endHeapIndex (${endHeapIndex})
|
|
16319
16330
|
`;
|
|
16320
16331
|
this.ensureNotFinalized();
|
|
16321
|
-
const
|
|
16322
|
-
const
|
|
16323
|
-
|
|
16324
|
-
|
|
16332
|
+
const heapRange = MemoryRange.fromStartAndLength(startHeapIndex, endHeapIndex - startHeapIndex);
|
|
16333
|
+
const heapPagesRange = PageRange.fromMemoryRange(heapRange);
|
|
16334
|
+
const initializedPageNumbers = Array.from(this.initialMemory.keys());
|
|
16335
|
+
for (const pageNumber of initializedPageNumbers) {
|
|
16336
|
+
if (heapPagesRange.isInRange(pageNumber)) {
|
|
16325
16337
|
throw new IncorrectSbrkIndex();
|
|
16326
16338
|
}
|
|
16327
16339
|
}
|