Bug 1117131. Output the JS hooks for our cache-clearing stuff for [Pure] properties on JS-implemented objects even if we have no interface object, since these live on instances. r=mccr8
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 02 Jan 2015 17:08:33 -0500
changeset 247737 b12bf3c3d05a52c58f51aeb2e4d237046bdfa6b0
parent 247736 8564f04a6f14f9b5f5a5ef7f46f2cbeacfda1318
child 247738 fea8c83aef600f036ee901c2a7dc9d3e5f00557b
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1117131
milestone37.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 1117131. Output the JS hooks for our cache-clearing stuff for [Pure] properties on JS-implemented objects even if we have no interface object, since these live on instances. r=mccr8
dom/bindings/Codegen.py
dom/bindings/test/TestJSImplGen.webidl
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -2263,27 +2263,27 @@ class MethodDefiner(PropertyDefiner):
                     "nativeName": "UnforgeableValueOf",
                     "methodInfo": False,
                     "length": 0,
                     "flags": "JSPROP_ENUMERATE", # readonly/permanent added
                                                  # automatically.
                     "condition": MemberCondition(None, None)
                 })
 
-        if (descriptor.interface.isJSImplemented() and
-            descriptor.interface.hasInterfaceObject()):
+        if descriptor.interface.isJSImplemented():
             if static:
-                self.chrome.append({
-                    "name": '_create',
-                    "nativeName": ("%s::_Create" % descriptor.name),
-                    "methodInfo": False,
-                    "length": 2,
-                    "flags": "0",
-                    "condition": MemberCondition(None, None)
-                })
+                if descriptor.interface.hasInterfaceObject():
+                    self.chrome.append({
+                        "name": '_create',
+                        "nativeName": ("%s::_Create" % descriptor.name),
+                        "methodInfo": False,
+                        "length": 2,
+                        "flags": "0",
+                        "condition": MemberCondition(None, None)
+                    })
             else:
                 for m in clearableCachedAttrs(descriptor):
                     attrName = MakeNativeName(m.identifier.name)
                     self.chrome.append({
                         "name": "_clearCached%sValue" % attrName,
                         "nativeName": MakeJSImplClearCachedValueNativeName(m),
                         "methodInfo": False,
                         "length": "0",
--- a/dom/bindings/test/TestJSImplGen.webidl
+++ b/dom/bindings/test/TestJSImplGen.webidl
@@ -738,8 +738,15 @@ interface TestNavigator {
 interface TestNavigatorWithConstructor {
 };
 
 interface TestCImplementedInterface : TestJSImplInterface {
 };
 
 interface TestCImplementedInterface2 {
 };
+
+[NoInterfaceObject,
+ JSImplementation="@mozilla.org/test-js-impl-interface;2"]
+interface TestJSImplNoInterfaceObject {
+  [Cached, Pure]
+  readonly attribute byte cachedByte;
+};