Skip to content

Commit

Permalink
Bug 1550545, part 1 - Remove the unused isScriptable methods. r=nika
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D30526

--HG--
extra : moz-landing-system : lando
  • Loading branch information
amccreight committed May 9, 2019
1 parent 0cbbf6f commit 083d1d9
Showing 1 changed file with 0 additions and 42 deletions.
42 changes: 0 additions & 42 deletions xpcom/idl-parser/xpidl/xpidl.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

"""A type conforms to the following pattern:
def isScriptable(self):
'returns True or False'
def nativeType(self, calltype):
'returns a string representation of the native type
calltype must be 'in', 'out', 'inout', or 'element'
Expand Down Expand Up @@ -124,9 +121,6 @@ def __init__(self, name, nativename, rustname, signed=False, maybeConst=False):
self.signed = signed
self.maybeConst = maybeConst

def isScriptable(self):
return True

def isPointer(self):
"""Check if this type is a pointer type - this will control how pointers act"""
return self.nativename.endswith('*')
Expand Down Expand Up @@ -415,9 +409,6 @@ def resolve(self, parent):
if not isinstance(self.realtype, (Builtin, Native, Typedef)):
raise IDLError("Unsupported typedef target type", self.location)

def isScriptable(self):
return self.realtype.isScriptable()

def nativeType(self, calltype):
return "%s %s" % (self.name, '*' if 'out' in calltype else '')

Expand Down Expand Up @@ -456,9 +447,6 @@ def resolve(self, parent):

parent.setName(self)

def isScriptable(self):
return True

def nativeType(self, calltype):
if calltype == 'element':
return 'RefPtr<%s>' % self.name
Expand Down Expand Up @@ -524,18 +512,6 @@ def __eq__(self, other):
def resolve(self, parent):
parent.setName(self)

def isScriptable(self):
if self.specialtype is None:
return False

if self.specialtype == 'promise':
return self.modifier == 'ptr'

if self.specialtype == 'nsid':
return self.modifier is not None

return self.modifier == 'ref'

def isPtr(self, calltype):
return self.modifier == 'ptr'

Expand Down Expand Up @@ -655,9 +631,6 @@ def resolve(self, parent):

parent.setName(self)

def isScriptable(self):
return True # All DOM objects are script exposed.

def nativeType(self, calltype):
if calltype == 'element':
return 'RefPtr<%s>' % self.native
Expand Down Expand Up @@ -755,12 +728,6 @@ def resolve(self, parent):
if self.countEntries() > 250 and not self.attributes.builtinclass:
raise IDLError("interface '%s' has too many entries" % self.name, self.location)

def isScriptable(self):
# NOTE: this is not whether *this* interface is scriptable... it's
# whether, when used as a type, it's scriptable, which is true of all
# interfaces.
return True

def nativeType(self, calltype, const=False):
if calltype == 'element':
return 'RefPtr<%s>' % self.name
Expand Down Expand Up @@ -983,9 +950,6 @@ def resolve(self, iface):
def count(self):
return 0

def isScriptable(self):
return True

def nativeType(self, calltype):
if 'out' in calltype:
return "%s::%s *" % (self.iface.name, self.basename)
Expand Down Expand Up @@ -1297,9 +1261,6 @@ def __init__(self, basetype):
self.type = basetype
self.location = self.type.location

def isScriptable(self):
return self.type.isScriptable()

def nativeType(self, calltype, const=False):
if 'element' in calltype:
raise IDLError("nested [array] unsupported", self.location)
Expand Down Expand Up @@ -1333,9 +1294,6 @@ def name(self):
def resolve(self, idl):
idl.getName(self.type, self.location)

def isScriptable(self):
return self.type.isScriptable()

def nativeType(self, calltype):
if calltype == 'legacyelement':
raise IDLError("[array] Array<T> is unsupported", self.location)
Expand Down

0 comments on commit 083d1d9

Please sign in to comment.