Closed
Bug 1400275
Opened 7 years ago
Closed 7 years ago
Assertion failure: givenProto == reflectorProto (How are we supposed to change the proto now?), at dom/bindings/BindingUtils.cpp:3740
Categories
(Core :: DOM: Core & HTML, defect, P1)
Tracking
()
RESOLVED
FIXED
mozilla57
People
(Reporter: bc, Assigned: bzbarsky)
References
()
Details
(Keywords: assertion)
Attachments
(2 files)
244.20 KB,
text/plain
|
Details | |
6.06 KB,
patch
|
qdot
:
review+
|
Details | Diff | Splinter Review |
1. https://app.wespeke.com/connect 2. Assertion failure: givenProto == reflectorProto (How are we supposed to change the proto now?), at /builds/worker/workspace/build/src/dom/bindings/BindingUtils.cpp:3740 #01: mozilla::dom::binding_detail::DoGetOrCreateDOMReflector<mozilla::dom::RTCPeerConnection, (mozilla::dom::binding_detail::GetOrCreateReflectorWrapBehavior)0u> [dom/bindings/BindingUtils.h:1100] #02: mozilla::dom::GetOrCreateDOMReflectorHelper<RefPtr<mozilla::dom::RTCPeerConnection>, true>::GetOrCreate [dom/bindings/BindingUtils.h:1863] #03: mozilla::dom::RTCPeerConnectionBinding::_constructor [dom/bindings/BindingUtils.h:1885] #04: js::CallJSNative [js/src/jscntxtinlines.h:294] #05: js::CallJSNativeConstructor [js/src/jscntxtinlines.h:326] #06: InternalConstruct [js/src/vm/Interpreter.cpp:599] #07: js::Construct [js/src/vm/Interpreter.cpp:637] #08: js::SpreadCallOperation [js/src/vm/Interpreter.cpp:4904] #09: Interpret [js/src/vm/Interpreter.cpp:3036] Windows, Linux; Beta/56, Nightly/57
Comment 1•7 years ago
|
||
This feels bad (so P1) and I'm guessing you're the best person to fix, Boris, but please correct me on both accounts if needed.
Assignee: nobody → bzbarsky
Flags: needinfo?(bzbarsky)
Priority: -- → P1
Assignee | ||
Comment 2•7 years ago
|
||
Oh, this is exciting. The page is subclassing RTCPeerConnection. Specifically, in https://static.opentok.com/v2/js/opentok.min.js we have this bit (somewhat de-minified): canUseES6Class = function(e) { var t = e.RTCPeerConnection||e.webkitRTCPeerConnection||e.mozRTCPeerConnection, n = extendParentClass(t); if (n) try { if (n.prototype.foo="bar","bar"=== new n(null).foo) return !0 } catch(e) {} return!1 } where extendParentClass is: extendParentClass = function extendParentClass(ParentClass){try{var ChildClass=eval('\n "use strict"; // Chrome<49 requires strict mode\n class ChildClass extends ParentClass {\n constructor(...args) {\n super(...args);\n try {\n this.__proto__ = ChildClass.prototype;\n } catch (e) {}\n }\n };\n ChildClass; // Ensure the final statement is returned in FF\n ');if(ChildClass&&ChildClass.prototype instanceof ParentClass)return ChildClass}catch(e){}return null} (not going to even try to prettyprint that). Anyway, the upshot is that they have an RTCPeerConnection subclass. This interface is JS-implemented, and for JS-implemented interfaces we create the reflector in the constructor, like so: http://searchfox.org/mozilla-central/rev/184f0c7888dd6abb32235377693b7d1fc0b75ac1/dom/bindings/Codegen.py#15359-15363 The good news is that we control all this code, so it's easy to fix. ;)
Flags: needinfo?(bzbarsky)
Assignee | ||
Comment 3•7 years ago
|
||
MozReview-Commit-ID: 5yYD92NVVFQ
Attachment #8908932 -
Flags: review?(kyle)
Updated•7 years ago
|
Attachment #8908932 -
Flags: review?(kyle) → review+
Pushed by bzbarsky@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/06ee47ac7e4d Ensure we create reflectors for JS-implemented webidl interfaces with the right prototype when those interfaces are subclassed. r=qdot
Comment 5•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/06ee47ac7e4d
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Updated•7 years ago
|
status-firefox55:
--- → wontfix
status-firefox-esr52:
--- → wontfix
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•