Skip to content

Commit

Permalink
Bug 1719795 part 6 - Remove null check for JS::GetClass return value.…
Browse files Browse the repository at this point in the history
… r=mccr8

Every JSObject has a non-null JSClass and a lot of code depends on this.

Differential Revision: https://phabricator.services.mozilla.com/D119618
  • Loading branch information
jandem committed Jul 13, 2021
1 parent 59f8590 commit f0855a5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions js/xpconnect/src/XPCConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ using namespace JS;

// static
bool XPCConvert::GetISupportsFromJSObject(JSObject* obj, nsISupports** iface) {
const JSClass* jsclass = JS::GetClass(obj);
MOZ_ASSERT(jsclass, "obj has no class");
if (jsclass && jsclass->slot0IsISupports()) {
if (JS::GetClass(obj)->slot0IsISupports()) {
*iface = JS::GetObjectISupports<nsISupports>(obj);
return true;
}
Expand Down

0 comments on commit f0855a5

Please sign in to comment.