mini_racer-csim 0.21.1.3 → 0.21.1.4
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.
- checksums.yaml +4 -4
- data/CHANGELOG +3 -0
- data/ext/mini_racer_csim_extension/mini_racer_v8.cc +53 -36
- data/lib/mini_racer_csim/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4a64c6a3cd59b38b736212c4ef9685cbc7c6bc9e56d0aee12734e957e749fb7c
|
|
4
|
+
data.tar.gz: 50e7e8a671b90f3bf2e6563092f31ed00edf7d2c8093eb52eccbe502635773ca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53cb234c4dca6643756f5f0558080dade542569bf64aef713e0f44477e05d2c7e14bc305f63671519d67131a63f35dcee65829893dd493011b5f2764552677bd
|
|
7
|
+
data.tar.gz: ee5e61767e56179bf2aec29c54ca81d0f3c6b3ad7d1788498bb45b84ee5f7d3b6dcb613cc5f297dbdcb4eae32f4005b594a6a7a562d51c9d1904b646537976cb
|
data/CHANGELOG
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
- 0.21.1.4 - 08-06-2026
|
|
2
|
+
- Memoize the safe-context reply filter (the recursive deep-copy fallback used when a reply value is not cloneable by V8's ValueSerializer — e.g. it contains a function or a host object). A visited-set (original → filtered copy) makes shared subgraphs clone once instead of being re-walked per reference path (O(N) instead of super-linear), terminates cycles (previously a cyclic value containing a non-cloneable member recursed forever), and preserves object identity — matching the ValueSerializer fast path it backs
|
|
3
|
+
|
|
1
4
|
- 0.21.1.3 - 08-06-2026
|
|
2
5
|
- **Breaking (realm JS API):** move the per-frame-realm JS helpers off bare `globalThis` globals onto the opt-in host namespace, so globalThis pollution is decided once (by `host_namespace:`) rather than per feature
|
|
3
6
|
- `__mr_realmGlobal(id)` → `<host_namespace>.realmGlobal(id)`
|
|
@@ -23,44 +23,61 @@ static const char safe_context_script_source[] = R"js(
|
|
|
23
23
|
;(function($globalThis) {
|
|
24
24
|
const {Map: $Map, Set: $Set} = $globalThis
|
|
25
25
|
const sentinel = {}
|
|
26
|
-
return function filter(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
26
|
+
return function filter(root) {
|
|
27
|
+
// Memoize original -> filtered copy. Registered BEFORE recursing into a
|
|
28
|
+
// value's children so that a value reachable by many paths is cloned
|
|
29
|
+
// once (linear, not super-linear: e.g. a DOM node's ownerDocument is
|
|
30
|
+
// reachable from every node), cycles terminate (the in-progress copy is
|
|
31
|
+
// returned), and object identity is preserved. This matches V8's
|
|
32
|
+
// ValueSerializer (the fast path this is the fallback for), whose ref
|
|
33
|
+
// table also dedupes and handles cycles; without it the slow path both
|
|
34
|
+
// diverges (duplicates shared objects) and can recurse forever on a
|
|
35
|
+
// cyclic value that happens to contain a non-cloneable member.
|
|
36
|
+
const seen = new Map()
|
|
37
|
+
return (function rec(v) {
|
|
38
|
+
if (typeof v === "function")
|
|
39
|
+
return sentinel
|
|
40
|
+
if (typeof v !== "object" || v === null)
|
|
41
|
+
return v
|
|
42
|
+
if (seen.has(v))
|
|
43
|
+
return seen.get(v)
|
|
44
|
+
if (v instanceof $Map) {
|
|
45
|
+
const m = new Map()
|
|
46
|
+
seen.set(v, m)
|
|
47
|
+
for (let [k, t] of Map.prototype.entries.call(v)) {
|
|
48
|
+
t = rec(t)
|
|
49
|
+
if (t !== sentinel)
|
|
50
|
+
m.set(k, t)
|
|
51
|
+
}
|
|
52
|
+
return m
|
|
53
|
+
} else if (v instanceof $Set) {
|
|
54
|
+
const s = new Set()
|
|
55
|
+
seen.set(v, s)
|
|
56
|
+
for (let t of Set.prototype.values.call(v)) {
|
|
57
|
+
t = rec(t)
|
|
58
|
+
if (t !== sentinel)
|
|
59
|
+
s.add(t)
|
|
57
60
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
return s
|
|
62
|
+
} else {
|
|
63
|
+
const o = Array.isArray(v) ? [] : {}
|
|
64
|
+
seen.set(v, o)
|
|
65
|
+
const pds = Object.getOwnPropertyDescriptors(v)
|
|
66
|
+
for (const [k, d] of Object.entries(pds)) {
|
|
67
|
+
if (!d.enumerable)
|
|
68
|
+
continue
|
|
69
|
+
let t = d.value
|
|
70
|
+
if (d.get) {
|
|
71
|
+
// *not* d.get.call(...), may have been tampered with
|
|
72
|
+
t = Function.prototype.call.call(d.get, v, k)
|
|
73
|
+
}
|
|
74
|
+
t = rec(t)
|
|
75
|
+
if (t !== sentinel)
|
|
76
|
+
Object.defineProperty(o, k, {value: t, enumerable: true})
|
|
77
|
+
}
|
|
78
|
+
return o
|
|
61
79
|
}
|
|
62
|
-
|
|
63
|
-
}
|
|
80
|
+
})(root)
|
|
64
81
|
}
|
|
65
82
|
})
|
|
66
83
|
)js";
|
|
@@ -4,6 +4,6 @@ module MiniRacerCsim
|
|
|
4
4
|
# mini_racer-csim fork: upstream version + a fork revision segment.
|
|
5
5
|
# 0.21.1.0 = first fork release on upstream 0.21.1; bump the 4th segment for
|
|
6
6
|
# fork-only changes, reset it when rebasing onto a new upstream version.
|
|
7
|
-
VERSION = "0.21.1.
|
|
7
|
+
VERSION = "0.21.1.4"
|
|
8
8
|
LIBV8_NODE_VERSION = "~> 24.12.0.1"
|
|
9
9
|
end
|