Bug 987111 - Proxy::set should create enumerable properties. r=efaust
☠☠ backed out by fe14647a422d ☠ ☠
authorBobby Holley <bobbyholley@gmail.com>
Wed, 04 Jun 2014 15:12:26 -0700
changeset 205920 944d128f135aeebe1d91d940f5ad1d81917db58f
parent 205919 33860f30fc4f41fd66cf8a6ce65f78eede465b1a
child 205921 e7b7548867d998b0e6a9e534860cac5506314a7d
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [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
@@ -2582,16 +2582,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();