Bug 987111 - Proxy::set should create enumerable properties. r=efaust
authorBobby Holley <bobbyholley@gmail.com>
Thu, 05 Jun 2014 22:32:38 -0700
changeset 207328 c4d288e2a0a6fb25c2af66bcc4c5f35e55eb445b
parent 207327 4fdeccffdf55f8ab558d67c9f755d8453bfb57c4
child 207329 3a1f67c7f2236d21592f107a1ff65e9077589564
push id494
push userraliiev@mozilla.com
push dateMon, 25 Aug 2014 18:42:16 +0000
treeherdermozilla-release@a3cc3e46b571 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersefaust
bugs987111
milestone32.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 987111 - Proxy::set should create enumerable properties. r=efaust Properties are supposed to be enumerable by default. It's unfortunate that the default is reversed in SpiderMonkey.
js/src/jsproxy.cpp
--- a/js/src/jsproxy.cpp
+++ b/js/src/jsproxy.cpp
@@ -2573,16 +2573,17 @@ Proxy::set(JSContext *cx, HandleObject p
         return false;
     if (desc.object() && desc.setter() && desc.setter() != JS_StrictPropertyStub)
         return CallSetter(cx, receiver, id, desc.setter(), desc.attributes(), strict, vp);
 
     // Ok. Either there was no pre-existing property, or it was a value prop
     // that we're going to shadow. Make a property descriptor and define it.
     Rooted<PropertyDescriptor> newDesc(cx);
     newDesc.value().set(vp);
+    newDesc.setAttributes(JSPROP_ENUMERATE);
     return handler->defineProperty(cx, receiver, id, &newDesc);
 }
 
 bool
 Proxy::keys(JSContext *cx, HandleObject proxy, AutoIdVector &props)
 {
     JS_CHECK_RECURSION(cx, return false);
     BaseProxyHandler *handler = proxy->as<ProxyObject>().handler();