mol_jsx_lib 0.0.705 → 0.0.706

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/node.js CHANGED
@@ -349,7 +349,7 @@ var $;
349
349
  };
350
350
  }
351
351
  error(message, Class = Error) {
352
- return new Class(`${message}${this}`);
352
+ return new Class(`${message} (${this})`);
353
353
  }
354
354
  span(row, col, length) {
355
355
  return new $mol_span(this.uri, this.source, row, col, length);
@@ -364,11 +364,11 @@ var $;
364
364
  if (end < 0)
365
365
  end += len;
366
366
  if (begin < 0 || begin > len)
367
- this.$.$mol_fail(`Begin value '${begin}' out of range ${this}`);
367
+ this.$.$mol_fail(this.error(`Begin value '${begin}' out of range`, RangeError));
368
368
  if (end < 0 || end > len)
369
- this.$.$mol_fail(`End value '${end}' out of range ${this}`);
369
+ this.$.$mol_fail(this.error(`End value '${end}' out of range`, RangeError));
370
370
  if (end < begin)
371
- this.$.$mol_fail(`End value '${end}' can't be less than begin value ${this}`);
371
+ this.$.$mol_fail(this.error(`End value '${end}' can't be less than begin value`, RangeError));
372
372
  return this.span(this.row, this.col + begin, end - begin);
373
373
  }
374
374
  }