Bug 907727 - Make sure to properly forward gets to the expando object for DOM proxies. r=peterv, a=abillings
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 22 Aug 2013 09:46:27 -0400
changeset 153838 638f571cd0325a3eb2ff7dd5f910626f59d5fcd5
parent 153837 d3736955cf312bb2abdac3630ac8cd99612cddcc
child 153839 3eb09b0574d86c5c9816f1a0734c4d18c7c8ee83
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv, abillings
bugs907727
milestone25.0a2
Bug 907727 - Make sure to properly forward gets to the expando object for DOM proxies. r=peterv, a=abillings
dom/bindings/Codegen.py
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -7661,17 +7661,19 @@ class CGDOMJSProxyHandler_get(ClassMetho
         getUnforgeableOrExpando += """JS::Rooted<JSObject*> expando(cx, DOMProxyHandler::GetExpandoObject(proxy));
 if (expando) {
   JSBool hasProp;
   if (!JS_HasPropertyById(cx, expando, id, &hasProp)) {
     return false;
   }
 
   if (hasProp) {
-    return JS_GetPropertyById(cx, expando, id, vp);
+    // Forward the get to the expando object, but our receiver is whatever our
+    // receiver is.
+    return JS_ForwardGetPropertyTo(cx, expando, id, receiver, vp);
   }
 }"""
 
         templateValues = {'jsvalRef': 'vp', 'jsvalHandle': 'vp', 'obj': 'proxy'}
 
         if self.descriptor.supportsIndexedProperties():
             getIndexedOrExpando = ("int32_t index = GetArrayIndexFromId(cx, id);\n" +
                                    "if (IsArrayIndex(index)) {\n" +