Closed Bug 1560553 Opened 5 years ago Closed 5 years ago

Improve the asserts in MaybeWrapNonDOMObjectValue

Categories

(Core :: DOM: Bindings (WebIDL), task)

task
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(2 files)

Right now those asserts are too stringent, for historical reasons that no longer apply, and block some reasonable code we actually want to write.

TryToOuterize fast-path bails out if a bit-check on the JSClass fails. Trying
to avoid that bit-check by checking for a DOM class, which is also a bit-check
on the JSClass doesn't really make sense.

We don't need to worry about JSCLASS_PRIVATE_IS_NSISUPPORTS, because the only
work we're really skipping here compared to MaybeWrapObjectValue is the
TryToOuterize call, and that only matters for Window objects, which always have
a DOM class.

Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1bf78850148b
part 1.  Simplify the TryToOuterize callers a bit.  r=peterv
https://hg.mozilla.org/integration/autoland/rev/0b533d8d086e
part 2.  Improve the assertions in MaybeWrapNonDOMObjectValue.  r=peterv
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: