Bug 806033. Finish getting rid of stray [Infallible] annotation bits. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 05 Nov 2012 14:40:33 -0500
changeset 112344 13a34f4d0d67d4acdc5f9ce52d80592412411d85
parent 112343 d56f12af4cd16521030bc708e1963cd531602c5e
child 112345 8fd8e9243788363cd60db34a050ff97069d78f66
push id23812
push useremorley@mozilla.com
push dateTue, 06 Nov 2012 14:01:34 +0000
treeherdermozilla-central@f4aeed115e54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs806033
milestone19.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
Bug 806033. Finish getting rid of stray [Infallible] annotation bits. r=khuey
dom/bindings/parser/WebIDL.py
dom/bindings/parser/tests/test_attr.py
dom/bindings/parser/tests/test_method.py
dom/bindings/test/TestCodeGen.webidl
dom/webidl/TextDecoder.webidl
dom/webidl/TextEncoder.webidl
--- a/dom/bindings/parser/WebIDL.py
+++ b/dom/bindings/parser/WebIDL.py
@@ -2075,19 +2075,19 @@ class IDLAttribute(IDLInterfaceMember):
     def validate(self):
         pass
 
     def handleExtendedAttribute(self, attr):
         identifier = attr.identifier()
         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():
                 raise WebIDLError("[LenientThis] must take no arguments",
                                   [attr.location])
             if self.isStatic():
                 raise WebIDLError("[LenientThis] is only allowed on non-static "
                                   "attributes", [attr.location, self.location])
@@ -2570,23 +2570,23 @@ class IDLMethod(IDLInterfaceMember, IDLS
         # No valid distinguishing index.  Time to throw
         locations = self.locationsForArgCount(argc)
         raise WebIDLError("Signatures with %d arguments for method '%s' are not "
                           "distinguishable" % (argc, self.identifier.name),
                           locations)
 
     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 "
                               "[Unforgeable]",
                               [attr.location, self.location])
         elif identifier == "PutForwards":
             raise WebIDLError("Only attributes support [PutForwards]",
                               [attr.location, self.location])
--- a/dom/bindings/parser/tests/test_attr.py
+++ b/dom/bindings/parser/tests/test_attr.py
@@ -288,15 +288,15 @@ def WebIDLTest(parser, harness):
         (QName, name, type, readonly) = data
         checkAttr(attr, QName % "NullableArrayOfNullableTypes", name, type % "OrNullArrayOrNull", readonly)
 
     parser = parser.reset()
     threw = False
     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")
--- a/dom/bindings/parser/tests/test_method.py
+++ b/dom/bindings/parser/tests/test_method.py
@@ -131,28 +131,28 @@ def WebIDLTest(parser, harness):
         threw = True
     harness.ok(not threw, "Should allow integer to float type corecion")
 
     parser = parser.reset()
     threw = False
     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")
--- a/dom/bindings/test/TestCodeGen.webidl
+++ b/dom/bindings/test/TestCodeGen.webidl
@@ -420,28 +420,26 @@ dictionary DictContainingDict {
 };
 
 dictionary DictContainingSequence {
   sequence<long> ourSequence;
 };
 
 interface TestIndexedGetterInterface {
   getter long item(unsigned long index);
-  [Infallible]
   readonly attribute unsigned long length;
 };
 
 interface TestNamedGetterInterface {
   getter DOMString (DOMString name);
 };
 
 interface TestIndexedAndNamedGetterInterface {
   getter long (unsigned long index);
   getter DOMString namedItem(DOMString name);
-  [Infallible]
   readonly attribute unsigned long length;
 };
 
 interface TestIndexedSetterInterface {
   setter creator void setItem(unsigned long index, DOMString item);
   getter DOMString (unsigned long index);
 };
 
@@ -457,19 +455,17 @@ interface TestIndexedAndNamedSetterInter
   getter TestIndexedSetterInterface (DOMString name);
 };
 
 interface TestIndexedAndNamedGetterAndSetterInterface : TestIndexedSetterInterface {
   getter long item(unsigned long index);
   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;
 };
 
 interface TestIndexedDeleterInterface {
   deleter void delItem(unsigned long index);
   getter long (unsigned long index);
 };
 
--- a/dom/webidl/TextDecoder.webidl
+++ b/dom/webidl/TextDecoder.webidl
@@ -6,17 +6,16 @@
  * http://encoding.spec.whatwg.org/#interface-textdecoder
  *
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 [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);
 };
 
 dictionary TextDecoderOptions {
   boolean fatal = false;
 };
--- a/dom/webidl/TextEncoder.webidl
+++ b/dom/webidl/TextEncoder.webidl
@@ -6,17 +6,16 @@
  * http://encoding.spec.whatwg.org/#interface-textencoder
  *
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 [Constructor(optional DOMString label = "utf-8")]
 interface TextEncoder {
-  [SetterThrows]
   readonly attribute DOMString encoding;
   [Throws]
   Uint8Array encode(optional DOMString? input = null, optional TextEncodeOptions options);
 };
 
 dictionary TextEncodeOptions {
   boolean stream = false;
 };