Bug 959677. Fail codegen if a writable attribute is flagged PutForwards or Replaceable. r=smaug
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 14 Jan 2014 21:46:43 -0500
changeset 163439 2e691e6ce23a962bccd20347ab88ae22a6d9f07d
parent 163438 7cc30ae56811cae75aecc277251d1272f9ad2cc8
child 163440 fdf7c54abdcd0f2c91fc64d9ae08af6855382511
push id25996
push useremorley@mozilla.com
push dateWed, 15 Jan 2014 15:54:39 +0000
treeherdermozilla-central@dd2cf81c56b7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs959677
milestone29.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 959677. Fail codegen if a writable attribute is flagged PutForwards or Replaceable. r=smaug
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -8696,16 +8696,22 @@ class CGDescriptor(CGThing):
                     cgThings.append(CGSpecializedGetter(descriptor, m))
                     if m.hasLenientThis():
                         hasLenientGetter = True
                     elif m.getExtendedAttribute("CrossOriginReadable"):
                         crossOriginGetters.add(m.identifier.name)
                     else:
                         hasGetter = True
                 if not m.readonly:
+                    for extAttr in ["PutForwards", "Replaceable"]:
+                        if m.getExtendedAttribute(extAttr):
+                            raise TypeError("Writable attributes should not "
+                                            "have %s specified.\n"
+                                            "%s" %
+                                            (extAttr, m.location))
                     if m.isStatic():
                         assert descriptor.interface.hasInterfaceObject
                         cgThings.append(CGStaticSetter(descriptor, m))
                     elif descriptor.interface.hasInterfacePrototypeObject():
                         cgThings.append(CGSpecializedSetter(descriptor, m))
                         if m.hasLenientThis():
                             hasLenientSetter = True
                         elif m.getExtendedAttribute("CrossOriginWritable"):