@noego/testing 0.7.4 → 0.7.5
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/browser/index.js +3 -3
- package/dist/index.cjs +4 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
followFetchRedirects
|
|
3
|
-
} from "../chunk-YX44DAOH.js";
|
|
4
1
|
import {
|
|
5
2
|
acquireNativeBrowser,
|
|
6
3
|
startSharedBrowser
|
|
7
4
|
} from "../chunk-P26IJDOI.js";
|
|
5
|
+
import {
|
|
6
|
+
followFetchRedirects
|
|
7
|
+
} from "../chunk-YX44DAOH.js";
|
|
8
8
|
import "../chunk-DGUM43GV.js";
|
|
9
9
|
|
|
10
10
|
// src/browser/lifecycle.ts
|
package/dist/index.cjs
CHANGED
|
@@ -385,7 +385,6 @@ function recordOutcome(call, outcome, threw) {
|
|
|
385
385
|
else call.result = outcome;
|
|
386
386
|
return outcome;
|
|
387
387
|
}
|
|
388
|
-
var pristineMethods = /* @__PURE__ */ new WeakMap();
|
|
389
388
|
function createMethodDecorator(registry) {
|
|
390
389
|
const wrappers = /* @__PURE__ */ new WeakMap();
|
|
391
390
|
return function decorate(instance, token2) {
|
|
@@ -406,18 +405,6 @@ function createMethodDecorator(registry) {
|
|
|
406
405
|
throw new MethodNotCallableError(tokenLabel(token2), method);
|
|
407
406
|
}
|
|
408
407
|
}
|
|
409
|
-
if (Object.isExtensible(instance)) {
|
|
410
|
-
const pristine = pristineMethods.get(instance) ?? /* @__PURE__ */ new Map();
|
|
411
|
-
pristineMethods.set(instance, pristine);
|
|
412
|
-
for (const [method, { entryKey, descriptor }] of effective) {
|
|
413
|
-
const original = pristine.get(method) ?? instance[method];
|
|
414
|
-
pristine.set(method, original);
|
|
415
|
-
const wrapped = buildMethodWrapper(instance, method, descriptor, registry.state(entryKey, method), original);
|
|
416
|
-
Object.defineProperty(instance, method, { value: wrapped, configurable: true, writable: true, enumerable: false });
|
|
417
|
-
}
|
|
418
|
-
wrappers.set(instance, instance);
|
|
419
|
-
return instance;
|
|
420
|
-
}
|
|
421
408
|
const methodCache = /* @__PURE__ */ new Map();
|
|
422
409
|
const proxy = new Proxy(instance, {
|
|
423
410
|
get(target, prop, receiver) {
|
|
@@ -425,7 +412,7 @@ function createMethodDecorator(registry) {
|
|
|
425
412
|
let wrapped = methodCache.get(prop);
|
|
426
413
|
if (!wrapped) {
|
|
427
414
|
const { entryKey, descriptor } = effective.get(prop);
|
|
428
|
-
wrapped = buildMethodWrapper(target, prop, descriptor, registry.state(entryKey, prop)
|
|
415
|
+
wrapped = buildMethodWrapper(target, prop, descriptor, registry.state(entryKey, prop));
|
|
429
416
|
methodCache.set(prop, wrapped);
|
|
430
417
|
}
|
|
431
418
|
return wrapped;
|
|
@@ -438,9 +425,10 @@ function createMethodDecorator(registry) {
|
|
|
438
425
|
return proxy;
|
|
439
426
|
};
|
|
440
427
|
}
|
|
441
|
-
function buildMethodWrapper(target, method, descriptor, state
|
|
428
|
+
function buildMethodWrapper(target, method, descriptor, state) {
|
|
442
429
|
const callOriginal = (self, args) => {
|
|
443
|
-
|
|
430
|
+
const fn = target[method];
|
|
431
|
+
return fn.apply(self === void 0 ? target : self, args);
|
|
444
432
|
};
|
|
445
433
|
if (typeof descriptor === "function") {
|
|
446
434
|
const replacement = descriptor((...args) => callOriginal(target, args));
|