@typeberry/jam 0.1.2-dd9b0e2 → 0.1.2

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/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}${idx < data.length ? data[idx] : ""}`);
13417
- const msg = `${lvlText} [${levelAndName[1]}] ${val.join("")}`;
13416
+ const val = strings.map((v, idx) => `${v}${data[idx]}`);
13417
+ const msg = `${lvlText} [${levelAndName[1]}] ${val}`;
13418
13418
  if (level === Level.WARN) {
13419
13419
  console.warn(msg);
13420
13420
  }
@@ -15939,17 +15939,6 @@ 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
- }
15953
15942
  /** Checks if a range is empty (`length === 0`) */
15954
15943
  isEmpty() {
15955
15944
  return this.length === 0;
@@ -16329,11 +16318,10 @@ class MemoryBuilder {
16329
16318
  startHeapIndex (${startHeapIndex}) has to be less than or equal to endHeapIndex (${endHeapIndex})
16330
16319
  `;
16331
16320
  this.ensureNotFinalized();
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)) {
16321
+ const range = MemoryRange.fromStartAndLength(startHeapIndex, endHeapIndex - startHeapIndex);
16322
+ const pages = PageRange.fromMemoryRange(range);
16323
+ for (const pageNumber of pages) {
16324
+ if (this.initialMemory.has(pageNumber)) {
16337
16325
  throw new IncorrectSbrkIndex();
16338
16326
  }
16339
16327
  }