Bug 948227 - Make the Object.prototype.__proto__ setter strongly warn against its use, for perf reasons (and suggest Object.create instead). r=efaust
authorJeff Walden <jwalden@mit.edu>
Thu, 23 Jan 2014 14:35:08 -0800
changeset 191278 b79d5726ac06cef1508ac652e8bc58475cfb0840
parent 191277 9462764e880601ad89e8855e2194cb178cdb1c0e
child 191279 ed30fc4d3e178ad72fe63bf112956d96be876f6a
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersefaust
bugs948227
milestone30.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 948227 - Make the Object.prototype.__proto__ setter strongly warn against its use, for perf reasons (and suggest Object.create instead). r=efaust
js/src/vm/GlobalObject.h
--- a/js/src/vm/GlobalObject.h
+++ b/js/src/vm/GlobalObject.h
@@ -624,19 +624,17 @@ class GlobalObject : public JSObject
         // debuggers like Firebug (bug 934669).
         //return warnOnceAbout(cx, obj, WARNED_WATCH_DEPRECATED, JSMSG_OBJECT_WATCH_DEPRECATED);
         return true;
     }
 
     // Warn about use of the given __proto__ setter to attempt to mutate an
     // object's [[Prototype]], if no prior warning was given.
     static bool warnOnceAboutPrototypeMutation(JSContext *cx, HandleObject protoSetter) {
-        // Temporarily disabled until the second half of bug 948583 lands.
-        //return warnOnceAbout(cx, protoSetter, WARNED_PROTO_SETTING_SLOW, JSMSG_PROTO_SETTING_SLOW);
-        return true;
+        return warnOnceAbout(cx, protoSetter, WARNED_PROTO_SETTING_SLOW, JSMSG_PROTO_SETTING_SLOW);
     }
 
     static bool getOrCreateEval(JSContext *cx, Handle<GlobalObject*> global,
                                 MutableHandleObject eval);
 
     // Infallibly test whether the given value is the eval function for this global.
     bool valueIsEval(Value val);