MCPcopy Create free account
hub / github.com/marijnh/Eloquent-JavaScript / content

Method content

code/solutions/08_2_the_locked_box.js:7–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5 unlock() { this.locked = false; }
6 lock() { this.locked = true; }
7 get content() {
8 if (this.locked) throw new Error("Locked!");
9 return this.#content;
10 }
11};
12
13function withBoxUnlocked(body) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected