@glassly/jspolyfill 0.3.5-dev.835 → 0.3.5-dev.837
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/assets/startup.js +9 -2
- package/dist/startup.js +9 -2
- package/package.json +1 -1
- package/src/startup.ts +11 -2
package/assets/startup.js
CHANGED
|
@@ -254,9 +254,16 @@
|
|
|
254
254
|
let env;
|
|
255
255
|
try {
|
|
256
256
|
env = JSON.parse(envelopeJson);
|
|
257
|
-
} catch {
|
|
257
|
+
} catch (e) {
|
|
258
258
|
try {
|
|
259
|
-
|
|
259
|
+
const reason = e instanceof Error ? `${e.name}: ${e.message}` : String(e);
|
|
260
|
+
const length = typeof envelopeJson === "string" ? envelopeJson.length : -1;
|
|
261
|
+
__hostError(
|
|
262
|
+
JSON.stringify({
|
|
263
|
+
message: `Bad __deliver envelope JSON (${reason}; length=${length}, type=${typeof envelopeJson})`,
|
|
264
|
+
source: "__deliver"
|
|
265
|
+
})
|
|
266
|
+
);
|
|
260
267
|
} catch {
|
|
261
268
|
}
|
|
262
269
|
return;
|
package/dist/startup.js
CHANGED
|
@@ -254,9 +254,16 @@
|
|
|
254
254
|
let env;
|
|
255
255
|
try {
|
|
256
256
|
env = JSON.parse(envelopeJson);
|
|
257
|
-
} catch {
|
|
257
|
+
} catch (e) {
|
|
258
258
|
try {
|
|
259
|
-
|
|
259
|
+
const reason = e instanceof Error ? `${e.name}: ${e.message}` : String(e);
|
|
260
|
+
const length = typeof envelopeJson === "string" ? envelopeJson.length : -1;
|
|
261
|
+
__hostError(
|
|
262
|
+
JSON.stringify({
|
|
263
|
+
message: `Bad __deliver envelope JSON (${reason}; length=${length}, type=${typeof envelopeJson})`,
|
|
264
|
+
source: "__deliver"
|
|
265
|
+
})
|
|
266
|
+
);
|
|
260
267
|
} catch {
|
|
261
268
|
}
|
|
262
269
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glassly/jspolyfill",
|
|
3
|
-
"version": "0.3.5-dev.
|
|
3
|
+
"version": "0.3.5-dev.837",
|
|
4
4
|
"description": "JSRuntime polyfill bundle — installed into each per-miniapp JSContext (iOS-JSC, Android-QuickJS) at spawn time. Provides browser-like globals (console, timers, fetch, WebSocket, localStorage, crypto.subtle) over a single __dispatch native bridge, plus the __deliver / signalReady plumbing the host runtime relies on.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.ts",
|
package/src/startup.ts
CHANGED
|
@@ -373,9 +373,18 @@ declare const __nativeClearTimer: (token: number) => void
|
|
|
373
373
|
}
|
|
374
374
|
try {
|
|
375
375
|
env = JSON.parse(envelopeJson)
|
|
376
|
-
} catch {
|
|
376
|
+
} catch (e) {
|
|
377
|
+
// Parse failures include QuickJS memory/stack errors, so name the error and
|
|
378
|
+
// the size: a syntax error and an InternalError need different fixes.
|
|
377
379
|
try {
|
|
378
|
-
|
|
380
|
+
const reason = e instanceof Error ? `${e.name}: ${e.message}` : String(e)
|
|
381
|
+
const length = typeof envelopeJson === "string" ? envelopeJson.length : -1
|
|
382
|
+
__hostError(
|
|
383
|
+
JSON.stringify({
|
|
384
|
+
message: `Bad __deliver envelope JSON (${reason}; length=${length}, type=${typeof envelopeJson})`,
|
|
385
|
+
source: "__deliver",
|
|
386
|
+
}),
|
|
387
|
+
)
|
|
379
388
|
} catch {
|
|
380
389
|
/* ignore */
|
|
381
390
|
}
|