author | Boris Kudryavtsev <boriskk.work@gmail.com> |
Wed, 20 May 2015 21:55:00 +0200 | |
changeset 251123 | 9b481796d64bcda1702004c682d58767e1752e8a |
parent 251122 | b27206136b3fba9ff2c7fc78b04e10d744472796 |
child 251124 | 8277d0a1f7b47e4dfd8c7bc6b7ca5a1ac02fd8b6 |
push id | 61768 |
push user | cbook@mozilla.com |
push date | Thu, 02 Jul 2015 14:18:18 +0000 |
treeherder | mozilla-inbound@70839bf0a04e [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | khuey |
bugs | 1155968 |
milestone | 42.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/xpcom/idl-parser/xpidl.py +++ b/xpcom/idl-parser/xpidl.py @@ -154,18 +154,18 @@ class Location(object): def __init__(self, lexer, lineno, lexpos): self._lineno = lineno self._lexpos = lexpos self._lexdata = lexer.lexdata self._file = getattr(lexer, 'filename', "<unknown>") def __eq__(self, other): - return self._lexpos == other._lexpos and \ - self._file == other._file + return (self._lexpos == other._lexpos and + self._file == other._file) def resolve(self): if self._line: return startofline = self._lexdata.rfind('\n', 0, self._lexpos) + 1 endofline = self._lexdata.find('\n', self._lexpos, self._lexpos + 80) self._line = self._lexdata[startofline:endofline] @@ -427,20 +427,20 @@ class Native(object): raise IDLError("More than one special type", aloc) self.specialtype = name if self.specialtypes[name] is not None: self.nativename = self.specialtypes[name] else: raise IDLError("Unexpected attribute", aloc) def __eq__(self, other): - return self.name == other.name and \ - self.nativename == other.nativename and \ - self.modifier == other.modifier and \ - self.specialtype == other.specialtype + return (self.name == other.name and + self.nativename == other.nativename and + self.modifier == other.modifier and + self.specialtype == other.specialtype) def resolve(self, parent): parent.setName(self) def isScriptable(self): if self.specialtype is None: return False @@ -537,18 +537,17 @@ class Interface(object): for member in self.members: member.resolve(self) # The number 250 is NOT arbitrary; this number is the maximum number of # stub entries defined in xpcom/reflect/xptcall/genstubs.pl # Do not increase this value without increasing the number in that # location, or you WILL cause otherwise unknown problems! if self.countEntries() > 250 and not self.attributes.builtinclass: - raise IDLError("interface '%s' has too many entries" % self.name, - self.location) + 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): @@ -771,21 +770,21 @@ class Attribute(object): self.infallible = True else: raise IDLError("Unexpected attribute '%s'" % name, aloc) def resolve(self, iface): self.iface = iface self.realtype = iface.idl.getName(self.type, self.location) if (self.null is not None and - getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): + getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): raise IDLError("'Null' attribute can only be used on DOMString", self.location) if (self.undefined is not None and - getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): + getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): raise IDLError("'Undefined' attribute can only be used on DOMString", self.location) if self.infallible and not self.realtype.kind == 'builtin': raise IDLError('[infallible] only works on builtin types ' '(numbers, booleans, and raw char types)', self.location) if self.infallible and not iface.attributes.builtinclass: raise IDLError('[infallible] attributes are only allowed on ' @@ -976,21 +975,21 @@ class Param(object): else: raise IDLError("Unexpected attribute '%s'" % name, aloc) def resolve(self, method): self.realtype = method.iface.idl.getName(self.type, self.location) if self.array: self.realtype = Array(self.realtype) if (self.null is not None and - getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): + getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): raise IDLError("'Null' attribute can only be used on DOMString", self.location) if (self.undefined is not None and - getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): + getBuiltinOrNativeTypeName(self.realtype) != '[domstring]'): raise IDLError("'Undefined' attribute can only be used on DOMString", self.location) def nativeType(self): kwargs = {} if self.shared: kwargs['shared'] = True if self.const: