@jxsuite/runtime 4.0.1 → 4.0.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/dist/runtime.js CHANGED
@@ -700,7 +700,11 @@ function reactiveReadArray(array) {
700
700
  if (raw === array)
701
701
  return raw;
702
702
  track(raw, "iterate", ARRAY_ITERATE_KEY);
703
- return isShallow(array) ? raw : raw.map(toReactive);
703
+ if (isShallow(array))
704
+ return raw;
705
+ if (!isReadonly(array))
706
+ return raw.map(toReactive);
707
+ return isReactive(array) ? raw.map((item) => toReadonly(toReactive(item))) : raw.map(toReadonly);
704
708
  }
705
709
  function shallowReadArray(arr) {
706
710
  track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY);
@@ -3461,16 +3465,10 @@ function sheetStateFor(doc) {
3461
3465
  var elementStyles = new WeakMap;
3462
3466
  var SCOPE_TOKEN = "\x01jx-scope\x01";
3463
3467
  function rewriteScratch(state) {
3464
- if (!state.scratch) {
3465
- return;
3466
- }
3467
3468
  state.scratch.replaceAll([...state.scratchOwners.values()].flat());
3468
3469
  }
3469
3470
  function releaseInterned(state, table, key) {
3470
3471
  const entry = table.get(key);
3471
- if (!entry) {
3472
- return;
3473
- }
3474
3472
  entry.refs -= 1;
3475
3473
  if (entry.refs <= 0) {
3476
3474
  table.delete(key);
@@ -4132,9 +4130,6 @@ async function importAndInstantiate(def, src, exportName, base) {
4132
4130
  }
4133
4131
  async function resolveClassJson(def, state, key, base) {
4134
4132
  const src = def.$src;
4135
- if (!src) {
4136
- throw new Error(`Jx: class entry '${key}' has no $src`);
4137
- }
4138
4133
  let classDef;
4139
4134
  const isBareSpecifier = !src.startsWith(".") && !src.startsWith("/") && !src.startsWith("http") && !src.startsWith("file:");
4140
4135
  if (isBareSpecifier) {
@@ -4946,5 +4941,5 @@ export {
4946
4941
  transposeCanvasUnits
4947
4942
  };
4948
4943
 
4949
- //# debugId=52C255A4DA099CA964756E2164756E21
4944
+ //# debugId=AA34AE79F7363B3164756E2164756E21
4950
4945
  //# sourceMappingURL=runtime.js.map