Bug 558249 - Followup fixes to bug 550402 to record setting getter-only properties better. r=jorendorff
authorJeff Walden <jwalden@mit.edu>
Mon, 12 Apr 2010 11:11:33 -0700
changeset 40873 7c910d18133066bc878af7498da792af82e101a8
parent 40872 47532d9153cb78087bbcd5e454ec74f50f85be22
child 40875 aafe18ae1d5b2cf7f48726bc03e26a44fd79a1f7
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersjorendorff
bugs558249, 550402
milestone1.9.3a5pre
Bug 558249 - Followup fixes to bug 550402 to record setting getter-only properties better. r=jorendorff
js/src/jsobj.cpp
js/src/trace-test/tests/basic/testSetGetterOnlyProperty.js
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -5016,16 +5016,18 @@ js_SetPropertyHelper(JSContext *cx, JSOb
          * optimize JS_UNLOCK_OBJ(cx, pobj) into JS_UNLOCK_SCOPE(cx, scope).
          */
         scope = pobj->scope();
 
         /* ES5 8.12.4 [[Put]] step 2. */
         if (sprop->isAccessorDescriptor()) {
             if (sprop->hasDefaultSetter()) {
                 JS_UNLOCK_SCOPE(cx, scope);
+                if (defineHow & JSDNP_CACHE_RESULT)
+                    TRACE_2(SetPropHit, JS_NO_PROP_CACHE_FILL, sprop);
                 return js_ReportGetterOnlyAssignment(cx);
             }
         } else {
             JS_ASSERT(sprop->isDataDescriptor());
 
             if (!sprop->writable()) {
                 JS_UNLOCK_SCOPE(cx, scope);
 
new file mode 100644
--- /dev/null
+++ b/js/src/trace-test/tests/basic/testSetGetterOnlyProperty.js
@@ -0,0 +1,5 @@
+var o = { get x() { return 17; } };
+for (var j = 0; j < 5; ++j)
+  o.x = 42;
+
+assertEq(true, true);