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 148418 7f23a0018f11b85b3e90eb711bdc5f043965a365
parent 148417 ba0b21a948d5845064497e87ed835408a4fb4062
child 148419 3f1e67b70d5ffe6cf32119e37e5cc5656ee653d1
push id2794
push userryanvm@gmail.com
push dateThu, 22 Aug 2013 20:35:27 +0000
treeherdermozilla-beta@3f1e67b70d5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv, abillings
bugs907727
milestone24.0
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
@@ -7321,17 +7321,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.address());
+    // Forward the get to the expando object, but our receiver is whatever our
+    // receiver is.
+    return JS_ForwardGetPropertyTo(cx, expando, id, receiver, vp.address());
   }
 }"""
 
         templateValues = {'jsvalRef': 'vp', 'jsvalHandle': 'vp', 'obj': 'proxy'}
 
         if self.descriptor.supportsIndexedProperties():
             getIndexedOrExpando = ("int32_t index = GetArrayIndexFromId(cx, id);\n" +
                                    "if (IsArrayIndex(index)) {\n" +