summaryrefslogtreecommitdiff
path: root/dom
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2023-07-13 04:07:05 -0500
committerBrian Smith <brian@dbsoft.org>2023-07-13 04:07:05 -0500
commitcb1aa7f456b4d44f4a1f5cdc63b490c8fb743a1b (patch)
tree511a1bd069a86f31aa3dd0a8ec4485180c0e5dc0 /dom
parent42cf583a575c2a2693c03982ded04bbea2468922 (diff)
downloaduxp-cb1aa7f456b4d44f4a1f5cdc63b490c8fb743a1b.tar.gz
Issue #1240 - Part 3c - Fast-forward to the V8 version of BigIntType.
Disabling some sections temporarily since the dependencies are not there yet. Based on the following: https://bugzilla.mozilla.org/show_bug.cgi?id=1502797 https://bugzilla.mozilla.org/show_bug.cgi?id=1471134 https://bugzilla.mozilla.org/show_bug.cgi?id=1441098 Part 3 & 4 Add structured clone support for BigInt and Enable BigInt wrapping from DOM bindings. https://bugzilla.mozilla.org/show_bug.cgi?id=1522738
Diffstat (limited to 'dom')
-rw-r--r--dom/bindings/BindingUtils.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h
index d55be9eb89..310cee15d1 100644
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -1037,11 +1037,18 @@ MaybeWrapValue(JSContext* cx, JS::MutableHandle<JS::Value> rval)
return MaybeWrapStringValue(cx, rval);
}
- if (!rval.isObject()) {
- return true;
+ if (rval.isObject()) {
+ return MaybeWrapObjectValue(cx, rval);
+ }
+ // This could be optimized by checking the zone first, similar to
+ // the way strings are handled. At present, this is used primarily
+ // for structured cloning, so avoiding the overhead of JS_WrapValue
+ // calls is less important than for other types.
+ if (rval.isBigInt()) {
+ return JS_WrapValue(cx, rval);
}
-
- return MaybeWrapObjectValue(cx, rval);
+ MOZ_ASSERT(rval.isSymbol());
+ return true;
}
namespace binding_detail {