async-browser-context 0.2.3 → 0.3.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.
- package/CHANGELOG.md +102 -0
- package/README.md +45 -30
- package/dist/babel/async-generator-helpers.d.ts +6 -6
- package/dist/babel/async-generator-helpers.d.ts.map +1 -1
- package/dist/babel/async-generator-helpers.js +33 -22
- package/dist/babel/async-generator-helpers.js.map +1 -1
- package/dist/babel/async-generator-resources.d.ts +14 -0
- package/dist/babel/async-generator-resources.d.ts.map +1 -0
- package/dist/babel/async-generator-resources.js +38 -0
- package/dist/babel/async-generator-resources.js.map +1 -0
- package/dist/babel/bind-generators.d.ts +1 -1
- package/dist/babel/bind-generators.d.ts.map +1 -1
- package/dist/babel/bind-generators.js +88 -44
- package/dist/babel/bind-generators.js.map +1 -1
- package/dist/babel/name-coroutines.d.ts +14 -8
- package/dist/babel/name-coroutines.d.ts.map +1 -1
- package/dist/babel/name-coroutines.js +160 -39
- package/dist/babel/name-coroutines.js.map +1 -1
- package/dist/babel/preset.d.ts +24 -13
- package/dist/babel/preset.d.ts.map +1 -1
- package/dist/babel/preset.js +37 -9
- package/dist/babel/preset.js.map +1 -1
- package/dist/babel/runtime-calls.d.ts +22 -0
- package/dist/babel/runtime-calls.d.ts.map +1 -0
- package/dist/babel/runtime-calls.js +69 -0
- package/dist/babel/runtime-calls.js.map +1 -0
- package/dist/babel/skip-runtime.d.ts +18 -11
- package/dist/babel/skip-runtime.d.ts.map +1 -1
- package/dist/babel/skip-runtime.js +52 -16
- package/dist/babel/skip-runtime.js.map +1 -1
- package/dist/babel/static-members.d.ts +4 -0
- package/dist/babel/static-members.d.ts.map +1 -0
- package/dist/babel/static-members.js +112 -0
- package/dist/babel/static-members.js.map +1 -0
- package/dist/core/async-generator.d.ts +51 -13
- package/dist/core/async-generator.d.ts.map +1 -1
- package/dist/core/async-generator.js +255 -58
- package/dist/core/async-generator.js.map +1 -1
- package/dist/core/async-local-storage.d.ts +3 -0
- package/dist/core/async-local-storage.d.ts.map +1 -1
- package/dist/core/async-local-storage.js +3 -0
- package/dist/core/async-local-storage.js.map +1 -1
- package/dist/core/callback-hook.d.ts +3 -3
- package/dist/core/coroutine.d.ts +6 -2
- package/dist/core/coroutine.d.ts.map +1 -1
- package/dist/core/coroutine.js +106 -44
- package/dist/core/coroutine.js.map +1 -1
- package/dist/core/function-name.d.ts +9 -0
- package/dist/core/function-name.d.ts.map +1 -0
- package/dist/core/function-name.js +12 -0
- package/dist/core/function-name.js.map +1 -0
- package/dist/core/hooks.d.ts +2 -1
- package/dist/core/hooks.d.ts.map +1 -1
- package/dist/core/hooks.js +21 -6
- package/dist/core/hooks.js.map +1 -1
- package/dist/core/snapshot.d.ts +2 -1
- package/dist/core/snapshot.d.ts.map +1 -1
- package/dist/core/snapshot.js +7 -3
- package/dist/core/snapshot.js.map +1 -1
- package/dist/core/store.d.ts +28 -0
- package/dist/core/store.d.ts.map +1 -1
- package/dist/core/store.js +90 -20
- package/dist/core/store.js.map +1 -1
- package/dist/core/variable.d.ts +2 -1
- package/dist/core/variable.d.ts.map +1 -1
- package/dist/core/variable.js +5 -2
- package/dist/core/variable.js.map +1 -1
- package/dist/node/index.d.ts +10 -4
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js +51 -16
- package/dist/node/index.js.map +1 -1
- package/dist/node/runtime.d.ts +7 -6
- package/dist/node/runtime.d.ts.map +1 -1
- package/dist/node/runtime.js +29 -16
- package/dist/node/runtime.js.map +1 -1
- package/dist/opentelemetry/context-manager.d.ts.map +1 -1
- package/dist/opentelemetry/context-manager.js +172 -13
- package/dist/opentelemetry/context-manager.js.map +1 -1
- package/dist/patches/callbacks.d.ts.map +1 -1
- package/dist/patches/callbacks.js +84 -29
- package/dist/patches/callbacks.js.map +1 -1
- package/dist/patches/events.d.ts.map +1 -1
- package/dist/patches/events.js +203 -91
- package/dist/patches/events.js.map +1 -1
- package/dist/patches/handler-interfaces.d.ts +3 -2
- package/dist/patches/handler-interfaces.d.ts.map +1 -1
- package/dist/patches/handler-interfaces.js +3 -2
- package/dist/patches/handler-interfaces.js.map +1 -1
- package/dist/patches/promise.d.ts +3 -0
- package/dist/patches/promise.d.ts.map +1 -1
- package/dist/patches/promise.js +13 -5
- package/dist/patches/promise.js.map +1 -1
- package/dist/patches/streams.d.ts.map +1 -1
- package/dist/patches/streams.js +36 -16
- package/dist/patches/streams.js.map +1 -1
- package/dist/patches/timers.d.ts.map +1 -1
- package/dist/patches/timers.js +17 -5
- package/dist/patches/timers.js.map +1 -1
- package/dist/patches/to-string.d.ts +4 -0
- package/dist/patches/to-string.d.ts.map +1 -1
- package/dist/patches/to-string.js +12 -6
- package/dist/patches/to-string.js.map +1 -1
- package/dist/runtime.d.ts +3 -3
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/runtime.js.map +1 -1
- package/dist/vite/plugin.d.ts +7 -2
- package/dist/vite/plugin.d.ts.map +1 -1
- package/dist/vite/plugin.js +30 -6
- package/dist/vite/plugin.js.map +1 -1
- package/package.json +49 -25
- package/src/babel/async-generator-helpers.ts +34 -23
- package/src/babel/async-generator-resources.ts +40 -0
- package/src/babel/bind-generators.ts +91 -47
- package/src/babel/name-coroutines.ts +170 -41
- package/src/babel/preset.ts +47 -15
- package/src/babel/runtime-calls.ts +73 -0
- package/src/babel/skip-runtime.ts +58 -18
- package/src/babel/static-members.ts +117 -0
- package/src/core/async-generator.ts +273 -62
- package/src/core/async-local-storage.ts +3 -0
- package/src/core/callback-hook.ts +3 -3
- package/src/core/coroutine.ts +104 -43
- package/src/core/function-name.ts +11 -0
- package/src/core/hooks.ts +23 -6
- package/src/core/snapshot.ts +8 -3
- package/src/core/store.ts +107 -21
- package/src/core/variable.ts +6 -2
- package/src/node/index.ts +62 -19
- package/src/node/runtime.ts +33 -15
- package/src/opentelemetry/context-manager.ts +188 -13
- package/src/patches/callbacks.ts +87 -30
- package/src/patches/events.ts +249 -103
- package/src/patches/handler-interfaces.ts +3 -2
- package/src/patches/promise.ts +17 -13
- package/src/patches/streams.ts +36 -16
- package/src/patches/timers.ts +17 -5
- package/src/patches/to-string.ts +12 -6
- package/src/runtime.ts +3 -3
- package/src/vite/plugin.ts +38 -8
|
@@ -1,4 +1,33 @@
|
|
|
1
1
|
import { ROOT_CONTEXT } from "@opentelemetry/api";
|
|
2
|
+
/** The methods of a Node.js EventEmitter that add a listener. */
|
|
3
|
+
const ADD_LISTENER_METHODS = ["addListener", "on", "once", "prependListener", "prependOnceListener"];
|
|
4
|
+
/** The emitters and event targets that bind() patched. A second bind() keeps the first context, as the context managers of OpenTelemetry do. */
|
|
5
|
+
const boundTargets = new WeakSet();
|
|
6
|
+
/**
|
|
7
|
+
* The bound listeners of each emitter or event target, so that a remove method finds the bound listener.
|
|
8
|
+
* The event names are property keys, as in the EventEmitter of Node.js. Thus `1` and `"1"` are the same
|
|
9
|
+
* event name, as for the event target, which changes the type to a string.
|
|
10
|
+
*/
|
|
11
|
+
const boundListeners = new WeakMap();
|
|
12
|
+
function listenersOf(target, event) {
|
|
13
|
+
let byEvent = boundListeners.get(target);
|
|
14
|
+
if (byEvent === undefined) {
|
|
15
|
+
// The object has no prototype, thus the event name "constructor" gives no inherited value
|
|
16
|
+
byEvent = Object.create(null);
|
|
17
|
+
boundListeners.set(target, byEvent);
|
|
18
|
+
}
|
|
19
|
+
let listeners = byEvent[event];
|
|
20
|
+
if (listeners === undefined) {
|
|
21
|
+
listeners = new WeakMap();
|
|
22
|
+
byEvent[event] = listeners;
|
|
23
|
+
}
|
|
24
|
+
return listeners;
|
|
25
|
+
}
|
|
26
|
+
/** This function gives the bound listener of `listener`, or `undefined` if the add methods did not bind it. */
|
|
27
|
+
function boundListenerOf(target, event, listener) {
|
|
28
|
+
// For a key that is not an object, WeakMap.get() gives undefined
|
|
29
|
+
return boundListeners.get(target)?.[event]?.get(listener);
|
|
30
|
+
}
|
|
2
31
|
/**
|
|
3
32
|
* This function makes the context manager class for one `AsyncLocalStorage`
|
|
4
33
|
* class: the class of the browser runtime, or the native class of Node.js.
|
|
@@ -11,31 +40,161 @@ export function defineContextManager(createStorage) {
|
|
|
11
40
|
active() {
|
|
12
41
|
return this.#storage.getStore() ?? ROOT_CONTEXT;
|
|
13
42
|
}
|
|
14
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* This method starts `fn` with `context` as the active context, also after each `await` in `fn`.
|
|
45
|
+
* With `thisArg` `null` or `undefined`, `fn` gets `undefined` as its `this` value, as in OpenTelemetry.
|
|
46
|
+
*/
|
|
15
47
|
with(context, fn, thisArg, ...args) {
|
|
16
|
-
return this.#storage.run(context, () =>
|
|
48
|
+
return this.#storage.run(context, () => Reflect.apply(fn, thisArg ?? undefined, args));
|
|
17
49
|
}
|
|
18
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* This method binds `target` to `context`, as the context managers of OpenTelemetry do:
|
|
52
|
+
*
|
|
53
|
+
* - A function gives a wrapper that starts it with `context` as the active context.
|
|
54
|
+
* - An event target (`addEventListener`) or a Node.js event emitter (`on`) gets a patch of
|
|
55
|
+
* its methods. Each listener that the program adds later operates with `context`, and the
|
|
56
|
+
* remove methods find the bound listener. A second `bind()` of the same object keeps the
|
|
57
|
+
* first context.
|
|
58
|
+
* - Other values stay as they are.
|
|
59
|
+
*
|
|
60
|
+
* Without a context, the method uses the active context.
|
|
61
|
+
*/
|
|
19
62
|
bind(context, target) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
63
|
+
const bound = context ?? this.active();
|
|
64
|
+
if (typeof target === "function") {
|
|
65
|
+
return this.#bindFunction(bound, target);
|
|
66
|
+
}
|
|
67
|
+
if (typeof target === "object" && target !== null && !boundTargets.has(target)) {
|
|
68
|
+
const methods = target;
|
|
69
|
+
if (typeof methods["addEventListener"] === "function") {
|
|
70
|
+
boundTargets.add(target);
|
|
71
|
+
this.#bindEventTarget(bound, target);
|
|
72
|
+
}
|
|
73
|
+
else if (typeof methods["on"] === "function" || typeof methods["addListener"] === "function") {
|
|
74
|
+
boundTargets.add(target);
|
|
75
|
+
this.#bindEmitter(bound, target);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
29
79
|
}
|
|
30
80
|
/** The manager is active when it exists. The method is for the `ContextManager` interface. */
|
|
31
81
|
enable() {
|
|
32
82
|
return this;
|
|
33
83
|
}
|
|
34
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* After this method, `active()` gives the root context in the current code. With the
|
|
86
|
+
* browser runtime and with Node.js 22, it also gives the root context in all other code
|
|
87
|
+
* until the next `with()`. With Node.js 24 and its AsyncContextFrame, the native class
|
|
88
|
+
* changes only the current context, also for the callbacks that this context registered.
|
|
89
|
+
*/
|
|
35
90
|
disable() {
|
|
36
91
|
this.#storage.disable();
|
|
37
92
|
return this;
|
|
38
93
|
}
|
|
94
|
+
/** With `guard`, the listener of an emitter clears the guard against nested adds while it operates (`#bindEmitter`). */
|
|
95
|
+
#bindFunction(context, fn, guard) {
|
|
96
|
+
const run = (call) => this.with(context, call);
|
|
97
|
+
const wrapper = function (...args) {
|
|
98
|
+
if (guard === undefined) {
|
|
99
|
+
return run(() => Reflect.apply(fn, this, args));
|
|
100
|
+
}
|
|
101
|
+
// A listener of "newListener" can add listeners during an add: they also get the context
|
|
102
|
+
const outer = guard.adding;
|
|
103
|
+
guard.adding = false;
|
|
104
|
+
try {
|
|
105
|
+
return run(() => Reflect.apply(fn, this, args));
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
guard.adding = outer;
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
Object.defineProperty(wrapper, "length", { value: fn.length, configurable: true });
|
|
112
|
+
return wrapper;
|
|
113
|
+
}
|
|
114
|
+
/** This method patches the methods of a Node.js event emitter, as `AsyncLocalStorageContextManager` of OpenTelemetry does. */
|
|
115
|
+
#bindEmitter(context, emitter) {
|
|
116
|
+
const methods = emitter;
|
|
117
|
+
// `once` of Node.js adds its own wrapper with `this.on`. That inner add must not wrap again,
|
|
118
|
+
// else `removeListener` does not find the listener. OpenTelemetry has the same guard.
|
|
119
|
+
const guard = { adding: false };
|
|
120
|
+
for (const name of ADD_LISTENER_METHODS) {
|
|
121
|
+
const original = methods[name];
|
|
122
|
+
if (typeof original !== "function") {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
const manager = this;
|
|
126
|
+
methods[name] = function (event, listener) {
|
|
127
|
+
if (guard.adding || typeof listener !== "function") {
|
|
128
|
+
return Reflect.apply(original, this, arguments);
|
|
129
|
+
}
|
|
130
|
+
const listeners = listenersOf(emitter, event);
|
|
131
|
+
let wrapper = listeners.get(listener);
|
|
132
|
+
if (wrapper === undefined) {
|
|
133
|
+
wrapper = manager.#bindFunction(context, listener, guard);
|
|
134
|
+
listeners.set(listener, wrapper);
|
|
135
|
+
}
|
|
136
|
+
guard.adding = true;
|
|
137
|
+
try {
|
|
138
|
+
return Reflect.apply(original, this, [event, wrapper]);
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
guard.adding = false;
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
for (const name of ["removeListener", "off"]) {
|
|
146
|
+
const original = methods[name];
|
|
147
|
+
if (typeof original !== "function") {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
methods[name] = function (event, listener) {
|
|
151
|
+
return Reflect.apply(original, this, [event, boundListenerOf(emitter, event, listener) ?? listener]);
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const removeAll = methods["removeAllListeners"];
|
|
155
|
+
if (typeof removeAll === "function") {
|
|
156
|
+
methods["removeAllListeners"] = function (event) {
|
|
157
|
+
if (arguments.length === 0) {
|
|
158
|
+
boundListeners.delete(emitter);
|
|
159
|
+
}
|
|
160
|
+
else {
|
|
161
|
+
delete boundListeners.get(emitter)?.[event];
|
|
162
|
+
}
|
|
163
|
+
return Reflect.apply(removeAll, this, arguments);
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** This method patches the methods of an event target, as `ZoneContextManager` of OpenTelemetry does. */
|
|
168
|
+
#bindEventTarget(context, target) {
|
|
169
|
+
const methods = target;
|
|
170
|
+
const add = methods["addEventListener"];
|
|
171
|
+
const remove = methods["removeEventListener"];
|
|
172
|
+
const manager = this;
|
|
173
|
+
methods["addEventListener"] = function (type, listener) {
|
|
174
|
+
if (typeof listener !== "function") {
|
|
175
|
+
return Reflect.apply(add, this, arguments);
|
|
176
|
+
}
|
|
177
|
+
const listeners = listenersOf(target, type);
|
|
178
|
+
let wrapper = listeners.get(listener);
|
|
179
|
+
if (wrapper === undefined) {
|
|
180
|
+
wrapper = manager.#bindFunction(context, listener);
|
|
181
|
+
listeners.set(listener, wrapper);
|
|
182
|
+
}
|
|
183
|
+
const args = Array.prototype.slice.call(arguments);
|
|
184
|
+
args[1] = wrapper;
|
|
185
|
+
return Reflect.apply(add, this, args);
|
|
186
|
+
};
|
|
187
|
+
if (typeof remove === "function") {
|
|
188
|
+
methods["removeEventListener"] = function (type, listener) {
|
|
189
|
+
const wrapper = boundListenerOf(target, type, listener);
|
|
190
|
+
const args = Array.prototype.slice.call(arguments);
|
|
191
|
+
if (wrapper !== undefined) {
|
|
192
|
+
args[1] = wrapper;
|
|
193
|
+
}
|
|
194
|
+
return Reflect.apply(remove, this, args);
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
39
198
|
};
|
|
40
199
|
}
|
|
41
200
|
//# sourceMappingURL=context-manager.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context-manager.js","sourceRoot":"","sources":["../../src/opentelemetry/context-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqC,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"context-manager.js","sourceRoot":"","sources":["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ources":["../../src/patches/callbacks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"callbacks.d.ts","sourceRoot":"","sources":["../../src/patches/callbacks.ts"],"names":[],"mappings":"AAiHA,wFAAwF;AACxF,wBAAgB,sBAAsB,IAAK,IAAI,CAoC9C"}
|
|
@@ -20,37 +20,86 @@ const PROTOTYPE_METHODS = [
|
|
|
20
20
|
/** The static methods that get callbacks and use them later. */
|
|
21
21
|
const STATIC_METHODS = [
|
|
22
22
|
["Notification", ["requestPermission"]],
|
|
23
|
-
["Array", ["fromAsync"]],
|
|
24
23
|
];
|
|
25
|
-
/** `source` is the name of the method, for the callback hooks. */
|
|
24
|
+
/** `source` is the name of the method, for the callback hooks. The replacement is a method, as the native function. */
|
|
26
25
|
function wrapArguments(source) {
|
|
27
|
-
return (original) =>
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
return (original) => ({
|
|
27
|
+
method(...args) {
|
|
28
|
+
return Reflect.apply(original, this, wrapFunctionArguments(args, source));
|
|
29
|
+
},
|
|
30
|
+
}).method;
|
|
30
31
|
}
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
/**
|
|
33
|
+
* `Array.fromAsync(items, mapFn, thisArg)` uses only `mapFn` later. `items` and `thisArg` can
|
|
34
|
+
* also be functions, and they must not change.
|
|
35
|
+
*/
|
|
36
|
+
function wrapFromAsync(original) {
|
|
37
|
+
return {
|
|
38
|
+
fromAsync() {
|
|
39
|
+
const mapFn = arguments[1];
|
|
40
|
+
if (typeof mapFn !== "function") {
|
|
41
|
+
return Reflect.apply(original, this, arguments);
|
|
42
|
+
}
|
|
43
|
+
const args = Array.prototype.slice.call(arguments);
|
|
44
|
+
args[1] = bindToFrame(store.current, mapFn, "Array.fromAsync");
|
|
45
|
+
return Reflect.apply(original, this, args);
|
|
46
|
+
},
|
|
47
|
+
}.fromAsync;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* This function gives a view of the dictionary `options` in which each key of `keys` gives a
|
|
51
|
+
* wrapper of its callback. The other members come from `options` with their getters and their
|
|
52
|
+
* prototype chain. The target of the Proxy is an empty object, so a frozen object also
|
|
53
|
+
* operates. The browser reads the members of a dictionary with [[Get]] only.
|
|
54
|
+
*/
|
|
55
|
+
function withCallback(options, keys, frame, source) {
|
|
56
|
+
const wrappers = new Map();
|
|
57
|
+
return new Proxy({}, {
|
|
58
|
+
get(_target, property) {
|
|
59
|
+
const value = Reflect.get(options, property, options);
|
|
60
|
+
if (typeof property !== "string" || !keys.includes(property) || typeof value !== "function") {
|
|
61
|
+
return value;
|
|
62
|
+
}
|
|
63
|
+
let wrapper = wrappers.get(property);
|
|
64
|
+
if (wrapper === undefined) {
|
|
65
|
+
wrapper = bindToFrame(frame, value, source);
|
|
66
|
+
wrappers.set(property, wrapper);
|
|
67
|
+
}
|
|
68
|
+
return wrapper;
|
|
69
|
+
},
|
|
70
|
+
// For an engine that examines a member with the `in` operator first, as the streams of WebKit do
|
|
71
|
+
has(_target, property) {
|
|
72
|
+
return Reflect.has(options, property);
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/** `startViewTransition()` gets a callback, or an object with an `update` callback. `source` names the class. */
|
|
77
|
+
function wrapViewTransition(source) {
|
|
78
|
+
return (original) => ({
|
|
79
|
+
startViewTransition() {
|
|
80
|
+
const first = arguments[0];
|
|
81
|
+
if (typeof first === "object" && first !== null) {
|
|
82
|
+
const args = Array.prototype.slice.call(arguments);
|
|
83
|
+
args[0] = withCallback(first, ["update"], store.current, source);
|
|
84
|
+
return Reflect.apply(original, this, args);
|
|
85
|
+
}
|
|
86
|
+
return Reflect.apply(original, this, wrapFunctionArguments(Array.prototype.slice.call(arguments), source));
|
|
87
|
+
},
|
|
88
|
+
}).startViewTransition;
|
|
43
89
|
}
|
|
44
|
-
/** `NavigateEvent.intercept()` gets an object with a `handler` callback. */
|
|
90
|
+
/** `NavigateEvent.intercept()` gets an object with a `handler` and a `precommitHandler` callback. */
|
|
45
91
|
function wrapIntercept(original) {
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
92
|
+
return {
|
|
93
|
+
intercept() {
|
|
94
|
+
const first = arguments[0];
|
|
95
|
+
if (typeof first === "object" && first !== null) {
|
|
96
|
+
const args = Array.prototype.slice.call(arguments);
|
|
97
|
+
args[0] = withCallback(first, ["handler", "precommitHandler"], store.current, "NavigateEvent.intercept");
|
|
98
|
+
return Reflect.apply(original, this, args);
|
|
99
|
+
}
|
|
100
|
+
return Reflect.apply(original, this, arguments);
|
|
101
|
+
},
|
|
102
|
+
}.intercept;
|
|
54
103
|
}
|
|
55
104
|
/** This function patches the callback APIs that are not events, timers or observers. */
|
|
56
105
|
export function installCallbackPatches() {
|
|
@@ -75,9 +124,15 @@ export function installCallbackPatches() {
|
|
|
75
124
|
replaceFunction(constructor, method, wrapArguments(`${constructorName}.${method}`));
|
|
76
125
|
}
|
|
77
126
|
}
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
80
|
-
replaceFunction(
|
|
127
|
+
const array = ownDataValue(globalThis, "Array");
|
|
128
|
+
if (typeof array === "function") {
|
|
129
|
+
replaceFunction(array, "fromAsync", wrapFromAsync);
|
|
130
|
+
}
|
|
131
|
+
for (const owner of ["Document", "Element"]) {
|
|
132
|
+
const prototype = globalPrototype(owner);
|
|
133
|
+
if (prototype !== undefined) {
|
|
134
|
+
replaceFunction(prototype, "startViewTransition", wrapViewTransition(`${owner}.startViewTransition`));
|
|
135
|
+
}
|
|
81
136
|
}
|
|
82
137
|
const navigateEventPrototype = globalPrototype("NavigateEvent");
|
|
83
138
|
if (navigateEventPrototype !== undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callbacks.js","sourceRoot":"","sources":["../../src/patches/callbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"callbacks.js","sourceRoot":"","sources":["../../src/patches/callbacks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAc,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAI1G;;;GAGG;AACH,MAAM,iBAAiB,GAAuD;IAC1E,CAAC,aAAa,EAAE,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;IACxD,CAAC,aAAa,EAAE,CAAC,SAAS,CAAC,CAAC;IAC5B,CAAC,mBAAmB,EAAE,CAAC,QAAQ,CAAC,CAAC;IACjC,CAAC,kBAAkB,EAAE,CAAC,aAAa,CAAC,CAAC;IACrC,CAAC,2BAA2B,EAAE,CAAC,aAAa,CAAC,CAAC;IAC9C,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC;IACjC,CAAC,0BAA0B,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,CAAC;IACzD,CAAC,iBAAiB,EAAE,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACjD,CAAC,kBAAkB,EAAE,CAAC,iBAAiB,CAAC,CAAC;IACzC,CAAC,cAAc,EAAE,CAAC,kBAAkB,CAAC,CAAC;IACtC,CAAC,mBAAmB,EAAE,CAAC,aAAa,EAAE,cAAc,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,UAAU,CAAC,CAAC;CACvI,CAAC;AAEF,gEAAgE;AAChE,MAAM,cAAc,GAAuD;IACvE,CAAC,cAAc,EAAE,CAAC,mBAAmB,CAAC,CAAC;CAC1C,CAAC;AAEF,uHAAuH;AACvH,SAAS,aAAa,CAAC,MAAe;IAClC,OAAO,CAAC,QAAQ,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I,cAAc,EAAE,CAAC;QACtD,MAAM,WAAW,GAAG,YAAY,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;QAC9D,IAAI,OAAO,WAAW,KAAK,UAAU,EAAE,CAAC;YACpC,SAAS;QACb,CAAC;QACD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC3B,eAAe,CAAS,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,GAAG,eAAe,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC;QAChG,CAAC;IACL,CAAC;IACD,MAAM,KAAK,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAChD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;QAC9B,eAAe,CAAS,KAAK,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IAC/D,CAAC;IACD,KAAK,MAAM,KAAK,IAAI,CAAC,UAAU,EAAE,SAAS,CAAC,EAAE,CAAC;QAC1C,MAAM,SAAS,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC1B,eAAe,CAAS,SAAS,EAAE,qBAAqB,EAAE,kBAAkB,CAAC,GAAG,KAAK,sBAAsB,CAAC,CAAC,CAAC;QAClH,CAAC;IACL,CAAC;IACD,MAAM,sBAAsB,GAAG,eAAe,CAAC,eAAe,CAAC,CAAC;IAChE,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;QACvC,eAAe,CAAS,sBAAsB,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IAChF,CAAC;AACL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/patches/events.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/patches/events.ts"],"names":[],"mappings":"AA+YA,yDAAyD;AACzD,wBAAgB,mBAAmB,IAAK,IAAI,CAO3C"}
|