@ai-ecoverse/slicc-kernel 1.52.0 → 1.53.0

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.
@@ -11128,19 +11128,35 @@ function hide(target, names) {
11128
11128
  }
11129
11129
  }
11130
11130
  }
11131
+ function vacate(target, names) {
11132
+ for (const name2 of names) {
11133
+ for (let at = target; at && at !== Object.prototype; ) {
11134
+ if (Object.getOwnPropertyDescriptor(at, name2)?.configurable) Reflect.deleteProperty(at, name2);
11135
+ at = Object.getPrototypeOf(at);
11136
+ }
11137
+ Reflect.defineProperty(target, name2, {
11138
+ value: void 0,
11139
+ writable: true,
11140
+ enumerable: false,
11141
+ configurable: true
11142
+ });
11143
+ if (Reflect.get(target, name2) !== void 0) {
11144
+ throw new Error(`slicc-kernel: cannot withhold ${name2} from a JS program`);
11145
+ }
11146
+ }
11147
+ }
11131
11148
  function lockdown(scope2 = globalThis) {
11132
11149
  hide(scope2, BLOCKED_GLOBALS);
11150
+ vacate(scope2, OPEN_SLOTS);
11133
11151
  const navigator = scope2.navigator;
11134
11152
  if (navigator && typeof navigator === "object") hide(navigator, BLOCKED_NAVIGATOR);
11135
11153
  }
11136
- var BLOCKED_GLOBALS, BLOCKED_NAVIGATOR;
11154
+ var BLOCKED_GLOBALS, BLOCKED_NAVIGATOR, OPEN_SLOTS;
11137
11155
  var init_lockdown = __esm({
11138
11156
  "src/process/js/lockdown.ts"() {
11139
11157
  "use strict";
11140
11158
  BLOCKED_GLOBALS = [
11141
- "fetch",
11142
11159
  "XMLHttpRequest",
11143
- "WebSocket",
11144
11160
  "WebSocketStream",
11145
11161
  "WebTransport",
11146
11162
  "EventSource",
@@ -11155,6 +11171,7 @@ var init_lockdown = __esm({
11155
11171
  "close"
11156
11172
  ];
11157
11173
  BLOCKED_NAVIGATOR = ["storage", "locks", "serviceWorker"];
11174
+ OPEN_SLOTS = ["fetch", "WebSocket"];
11158
11175
  }
11159
11176
  });
11160
11177