Bug 938355 part 2. Relax the restriction on [Pure] not mixing with [Throws] and annotate some more things as [Pure]. r=peterv

This commit is contained in:
Boris Zbarsky 2013-12-02 09:50:34 -05:00
Родитель 69a8f7bb18
Коммит 4ffa18ba5a
4 изменённых файлов: 10 добавлений и 18 удалений

Просмотреть файл

@ -6038,8 +6038,8 @@ class CGMemberJITInfo(CGThing):
reason (e.g. we have overloads or we're not a method) and
otherwise an iterable of the arguments for this method.
"""
assert(not constant or pure) # constants are always pure
assert(not hasSlot or pure) # Things with slots had better be pure
assert(not movable or aliasSet != "AliasEverything") # Can't move write-aliasing things
assert(not hasSlot or movable) # Things with slots had better be movable
protoID = "prototypes::id::%s" % self.descriptor.name
depth = "PrototypeTraits<%s>::Depth" % protoID
failstr = toStringBool(infallible)

Просмотреть файл

@ -2687,12 +2687,8 @@ class IDLAttribute(IDLInterfaceMember):
"[SetterThrows]",
[self.location])
elif (((identifier == "Throws" or identifier == "GetterThrows") and
(self.getExtendedAttribute("Pure") or
self.getExtendedAttribute("StoreInSlot") or
self.getExtendedAttribute("SameObject") or
self.getExtendedAttribute("Constant"))) or
((identifier == "Pure" or identifier == "SameObject" or
identifier == "Constant" or identifier == "StoreInSlot") and
self.getExtendedAttribute("StoreInSlot")) or
(identifier == "StoreInSlot" and
(self.getExtendedAttribute("Throws") or
self.getExtendedAttribute("GetterThrows")))):
raise WebIDLError("Throwing things can't be [Pure] or [Constant] "
@ -3286,10 +3282,6 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
elif identifier == "Constant":
raise WebIDLError("Methods must not be flagged as [Constant]",
[attr.location, self.location]);
elif ((identifier == "Pure" and self.getExtendedAttribute("Throws")) or
(identifier == "Throws" and self.getExtendedAttribute("Pure"))):
raise WebIDLError("Throwing methods can't be [Pure]",
[attr.location]);
elif identifier == "PutForwards":
raise WebIDLError("Only attributes support [PutForwards]",
[attr.location, self.location])

Просмотреть файл

@ -279,9 +279,9 @@ partial interface Document {
// http://dev.w3.org/2006/webapi/selectors-api2/#interface-definitions
partial interface Document {
[Throws]
[Throws, Pure]
Element? querySelector(DOMString selectors);
[Throws]
[Throws, Pure]
NodeList querySelectorAll(DOMString selectors);
//(Not implemented)Element? find(DOMString selectors, optional (Element or sequence<Node>)? refNodes);

Просмотреть файл

@ -56,7 +56,7 @@ interface Element : Node {
[Pure]
HTMLCollection getElementsByTagName(DOMString localName);
[Throws]
[Throws, Pure]
HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);
[Pure]
HTMLCollection getElementsByClassName(DOMString classNames);
@ -86,7 +86,7 @@ interface Element : Node {
*
* See <http://dev.w3.org/2006/webapi/selectors-api2/#matchesselector>
*/
[Throws]
[Throws, Pure]
boolean mozMatchesSelector(DOMString selector);
// Proprietary extensions
@ -188,9 +188,9 @@ partial interface Element {
// http://www.w3.org/TR/selectors-api/#interface-definitions
partial interface Element {
[Throws]
[Throws, Pure]
Element? querySelector(DOMString selectors);
[Throws]
[Throws, Pure]
NodeList querySelectorAll(DOMString selectors);
};