Bug 1348099 part 3 - Fix the codegen so the methods for clearing cached attribute values are not unforgeable. r?bz draft
authorTing-Yu Chou <janus926@gmail.com>
Thu, 29 Jun 2017 17:54:20 +0800
changeset 601998 84614cfa6a66
parent 601715 d5eba2ff18d6
child 635420 f7228891dc74
push id66234
push userbmo:janus926@gmail.com
push dateThu, 29 Jun 2017 10:04:13 +0000
reviewersbz
bugs1348099
milestone56.0a1
Bug 1348099 part 3 - Fix the codegen so the methods for clearing cached attribute values are not unforgeable. r?bz Current codegen list the methods for clearing cached attribute values in both chrome only unforgeable methods and chrome only normal methods, but they should exist only in the normal ones. MozReview-Commit-ID: Il2JvCLZ2v3
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -2564,17 +2564,17 @@ class MethodDefiner(PropertyDefiner):
                     self.chrome.append({
                         "name": '_create',
                         "nativeName": ("%s::_Create" % descriptor.name),
                         "methodInfo": False,
                         "length": 2,
                         "flags": "0",
                         "condition": MemberCondition()
                     })
-            else:
+            elif not unforgeable:
                 for m in clearableCachedAttrs(descriptor):
                     attrName = MakeNativeName(m.identifier.name)
                     self.chrome.append({
                         "name": "_clearCached%sValue" % attrName,
                         "nativeName": MakeJSImplClearCachedValueNativeName(m),
                         "methodInfo": False,
                         "length": "0",
                         "flags": "0",