Commit 677dab92 authored by henry's avatar henry Committed by Pier Angelo Vendrame
Browse files

fixup! Lox integration

Bug 42489: Return copies of Lox module internals to ensure they cannot
be edited by a caller.
parent fb56536d
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -526,7 +526,8 @@ class LoxImpl {
    if (!this.#initialized) {
      throw new LoxError(LoxErrors.NotInitialized);
    }
    return this.#invites;
    // Return a copy.
    return structuredClone(this.#invites);
  }

  /**
@@ -578,7 +579,7 @@ class LoxImpl {
      if (this.#invites.len > 50) {
        this.#invites.shift();
      }
      return invite;
      return structuredClone(invite);
    }
  }

@@ -775,7 +776,8 @@ class LoxImpl {
      );
      return [];
    }
    return this.#events;
    // Return a copy.
    return structuredClone(this.#events);
  }

  /**