Bug 908390 part 1. Make [Exposed] work correctly on jsonifiers and stringifiers and don't create an unforgeable toJSON just because we have a jsonifier. r=khuey
authorBoris Zbarsky <bzbarsky@mit.edu>
Fri, 29 Aug 2014 19:50:05 -0400
changeset 202544 f79c41150d2b960a708be3d12bb9fa1b82e2e72e
parent 202543 af6fa89ec5509baead12a11025ef4f5329dda01c
child 202545 02d549361c6d81bd108867ad544f3e5f341187ab
push id27402
push userryanvm@gmail.com
push dateSat, 30 Aug 2014 16:25:31 +0000
treeherdermozilla-central@983cf2175495 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs908390
milestone34.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 908390 part 1. Make [Exposed] work correctly on jsonifiers and stringifiers and don't create an unforgeable toJSON just because we have a jsonifier. r=khuey
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -2150,30 +2150,33 @@ class MethodDefiner(PropertyDefiner):
                 "length": 0,
                 "flags": "JSPROP_ENUMERATE",
                 "condition": MemberCondition(None, None)
             })
 
         if not static:
             stringifier = descriptor.operations['Stringifier']
             if (stringifier and
-                unforgeable == MemberIsUnforgeable(stringifier, descriptor)):
+                unforgeable == MemberIsUnforgeable(stringifier, descriptor) and
+                isMaybeExposedIn(stringifier, descriptor)):
                 toStringDesc = {
                     "name": "toString",
                     "nativeName": stringifier.identifier.name,
                     "length": 0,
                     "flags": "JSPROP_ENUMERATE",
                     "condition": PropertyDefiner.getControllingCondition(stringifier, descriptor)
                 }
                 if isChromeOnly(stringifier):
                     self.chrome.append(toStringDesc)
                 else:
                     self.regular.append(toStringDesc)
             jsonifier = descriptor.operations['Jsonifier']
-            if jsonifier:
+            if (jsonifier and
+                unforgeable == MemberIsUnforgeable(jsonifier, descriptor) and
+                isMaybeExposedIn(jsonifier, descriptor)):
                 toJSONDesc = {
                     "name": "toJSON",
                     "nativeName": jsonifier.identifier.name,
                     "length": 0,
                     "flags": "JSPROP_ENUMERATE",
                     "condition": PropertyDefiner.getControllingCondition(jsonifier, descriptor)
                 }
                 if isChromeOnly(jsonifier):