Back out revision c35458a437cc (bug 976305) for breaking DataStore tests. r=orange
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 25 Feb 2014 18:52:21 -0500
changeset 170919 104e8ce657cd6a2d7395c51ff5bf3a033b1e1496
parent 170918 53807be7d572014642edb40117b49905f8e2feb1
child 170920 6cf3762073dcf3f2c87b50d04afe4defd5814133
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersorange
bugs976305
milestone30.0a1
backs outc35458a437cc41eb755a774c2fdc5165c194ae09
Back out revision c35458a437cc (bug 976305) for breaking DataStore tests. r=orange
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -5934,17 +5934,20 @@ class CGAbstractStaticBindingMethod(CGAb
     """
     def __init__(self, descriptor, name):
         args = [Argument('JSContext*', 'cx'), Argument('unsigned', 'argc'),
                 Argument('JS::Value*', 'vp')]
         CGAbstractStaticMethod.__init__(self, descriptor, name, "bool", args)
 
     def definition_body(self):
         unwrap = CGGeneric("""JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
-JS::Rooted<JSObject*> obj(cx, &args.callee());""")
+JS::Rooted<JSObject*> obj(cx, args.computeThis(cx).toObjectOrNull());
+if (!obj) {
+  return false;
+}""")
         return CGList([ CGIndenter(unwrap),
                         self.generate_code() ], "\n\n").define()
 
     def generate_code(self):
         assert(False) # Override me
 
 def MakeNativeName(name):
     return name[0].upper() + name[1:]