Bug 806033. Finish getting rid of stray [Infallible] annotation bits. r=khuey

This commit is contained in:
Boris Zbarsky 2012-11-05 14:40:33 -05:00
parent f447d2024f
commit 0b3703ffee
6 changed files with 12 additions and 18 deletions

View File

@ -2080,9 +2080,9 @@ class IDLAttribute(IDLInterfaceMember):
if identifier == "TreatNonCallableAsNull":
raise WebIDLError("TreatNonCallableAsNull cannot be specified on attributes",
[attr.location, self.location])
elif identifier == "SetterInfallible" and self.readonly:
elif identifier == "SetterThrows" and self.readonly:
raise WebIDLError("Readonly attributes must not be flagged as "
"[SetterInfallible]",
"[SetterThrows]",
[self.location])
elif identifier == "LenientThis":
if not attr.noArguments():
@ -2575,13 +2575,13 @@ class IDLMethod(IDLInterfaceMember, IDLScope):
def handleExtendedAttribute(self, attr):
identifier = attr.identifier()
if identifier == "GetterInfallible":
if identifier == "GetterThrows":
raise WebIDLError("Methods must not be flagged as "
"[GetterInfallible]",
"[GetterThrows]",
[attr.location, self.location])
elif identifier == "SetterInfallible":
elif identifier == "SetterThrows":
raise WebIDLError("Methods must not be flagged as "
"[SetterInfallible]",
"[SetterThrows]",
[attr.location, self.location])
elif identifier == "Unforgeable":
raise WebIDLError("Methods must not be flagged as "

View File

@ -293,10 +293,10 @@ def WebIDLTest(parser, harness):
try:
parser.parse("""
interface A {
[SetterInfallible] readonly attribute boolean foo;
[SetterThrows] readonly attribute boolean foo;
};
""")
results = parser.finish()
except Exception, x:
threw = True
harness.ok(threw, "Should not allow [SetterInfallible] on readonly attributes")
harness.ok(threw, "Should not allow [SetterThrows] on readonly attributes")

View File

@ -136,23 +136,23 @@ def WebIDLTest(parser, harness):
try:
parser.parse("""
interface A {
[GetterInfallible] void foo();
[GetterThrows] void foo();
};
""")
results = parser.finish()
except Exception, x:
threw = True
harness.ok(threw, "Should not allow [GetterInfallible] on methods")
harness.ok(threw, "Should not allow [GetterThrows] on methods")
parser = parser.reset()
threw = False
try:
parser.parse("""
interface A {
[SetterInfallible] void foo();
[SetterThrows] void foo();
};
""")
results = parser.finish()
except Exception, x:
threw = True
harness.ok(threw, "Should not allow [SetterInfallible] on methods")
harness.ok(threw, "Should not allow [SetterThrows] on methods")

View File

@ -425,7 +425,6 @@ dictionary DictContainingSequence {
interface TestIndexedGetterInterface {
getter long item(unsigned long index);
[Infallible]
readonly attribute unsigned long length;
};
@ -436,7 +435,6 @@ interface TestNamedGetterInterface {
interface TestIndexedAndNamedGetterInterface {
getter long (unsigned long index);
getter DOMString namedItem(DOMString name);
[Infallible]
readonly attribute unsigned long length;
};
@ -462,9 +460,7 @@ interface TestIndexedAndNamedGetterAndSetterInterface : TestIndexedSetterInterfa
getter DOMString namedItem(DOMString name);
setter creator void (unsigned long index, long item);
setter creator void (DOMString name, DOMString item);
[Infallible]
stringifier DOMString ();
[Infallible]
readonly attribute unsigned long length;
};

View File

@ -11,7 +11,6 @@
[Constructor(optional DOMString label = "utf-8", optional TextDecoderOptions options)]
interface TextDecoder {
[SetterThrows]
readonly attribute DOMString encoding;
[Throws]
DOMString decode(optional ArrayBufferView? input = null, optional TextDecodeOptions options);

View File

@ -11,7 +11,6 @@
[Constructor(optional DOMString label = "utf-8")]
interface TextEncoder {
[SetterThrows]
readonly attribute DOMString encoding;
[Throws]
Uint8Array encode(optional DOMString? input = null, optional TextEncodeOptions options);