Bug 767929 - Use Maybe instead of Optional for the holder object in new DOM binding code. r=bzbarsky
authorMax Li <maxli@maxli.ca>
Sun, 12 May 2013 15:18:37 -0400
changeset 143625 662d99ac18fb46effecde04685c9c5b2ccff3943
parent 143624 55e6e91ea9305281a161f386f24a2b57403900a9
child 143626 f0661e6dd5b4e51db9002cf270d531b592a32a06
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs767929
milestone24.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 767929 - Use Maybe instead of Optional for the holder object in new DOM binding code. r=bzbarsky
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -3548,18 +3548,18 @@ def instantiateJSToNativeConversion(info
         declArgs = None
 
     result = CGList([], "\n")
     # Make a copy of "replacements" since we may be about to start modifying it
     replacements = dict(replacements)
     originalHolderName = replacements["holderName"]
     if holderType is not None:
         if dealWithOptional:
-            replacements["holderName"] = "%s.Value()" % originalHolderName
-            holderType = CGTemplatedType("Optional", holderType)
+            replacements["holderName"] = "%s.ref()" % originalHolderName
+            holderType = CGTemplatedType("Maybe", holderType)
             holderCtorArgs = None
         elif holderArgs is not None:
             holderCtorArgs = CGWrapper(holderArgs, pre="(", post=")")
         else:
             holderCtorArgs = None
         result.append(
             CGList([holderType, CGGeneric(" "),
                     CGGeneric(originalHolderName),
@@ -3587,17 +3587,17 @@ def instantiateJSToNativeConversion(info
     if argcAndIndex is not None:
         if dealWithOptional:
             declConstruct = CGIndenter(
                 CGGeneric("%s.Construct(%s);" %
                           (originalDeclName,
                            declArgs.define() if declArgs else "")))
             if holderType is not None:
                 holderConstruct = CGIndenter(
-                    CGGeneric("%s.Construct(%s);" %
+                    CGGeneric("%s.construct(%s);" %
                               (originalHolderName,
                                holderArgs.define() if holderArgs else "")))
             else:
                 holderConstruct = None
         else:
             declConstruct = None
             holderConstruct = None