Backed out changeset d59204040050 (bug 1265594) for SM bustage in rest-debugger.js
authorWes Kocher <wkocher@mozilla.com>
Tue, 19 Apr 2016 14:32:36 -0700
changeset 293937 8dbe34ec0786f8f8df51a47249c6fd19766fb630
parent 293936 02cbaad80b65e2317f4b800fe472f80649ba7612
child 293938 27b5119d82e01dded303cd795021483480ecd2e4
push id30194
push usercbook@mozilla.com
push dateWed, 20 Apr 2016 09:50:56 +0000
treeherdermozilla-central@f05a1242fb29 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1265594
milestone48.0a1
backs outd5920404005033ac00cd2eabdbb1826b30215269
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
Backed out changeset d59204040050 (bug 1265594) for SM bustage in rest-debugger.js MozReview-Commit-ID: G4EHXnHM1E2
js/src/builtin/Object.cpp
js/src/jsapi-tests/testGetPropertyDescriptor.cpp
js/src/jsapi.h
js/src/jsobj.cpp
js/src/jsobj.h
js/src/vm/Debugger.cpp
--- a/js/src/builtin/Object.cpp
+++ b/js/src/builtin/Object.cpp
@@ -672,17 +672,17 @@ js::obj_getOwnPropertyDescriptor(JSConte
     // Steps 3-4.
     RootedId id(cx);
     if (!ToPropertyKey(cx, args.get(1), &id))
         return false;
 
     // Steps 5-7.
     Rooted<PropertyDescriptor> desc(cx);
     return GetOwnPropertyDescriptor(cx, obj, id, &desc) &&
-           JS::FromPropertyDescriptor(cx, desc, args.rval());
+           FromPropertyDescriptor(cx, desc, args.rval());
 }
 
 enum EnumerableOwnPropertiesKind {
     Keys,
     Values,
     KeysAndValues
 };
 
--- a/js/src/jsapi-tests/testGetPropertyDescriptor.cpp
+++ b/js/src/jsapi-tests/testGetPropertyDescriptor.cpp
@@ -12,34 +12,16 @@ BEGIN_TEST(test_GetPropertyDescriptor)
 
   JS::RootedObject obj(cx, &v.toObject());
   JS::Rooted<JS::PropertyDescriptor> desc(cx);
 
   CHECK(JS_GetPropertyDescriptor(cx, obj, "somename", &desc));
   CHECK_EQUAL(desc.object(), obj);
   CHECK_SAME(desc.value(), JS::Int32Value(123));
 
-  JS::RootedValue descValue(cx);
-  CHECK(JS::FromPropertyDescriptor(cx, desc, &descValue));
-  CHECK(descValue.isObject());
-  JS::RootedObject descObj(cx, &descValue.toObject());
-  JS::RootedValue value(cx);
-  CHECK(JS_GetProperty(cx, descObj, "value", &value));
-  CHECK_EQUAL(value.toInt32(), 123);
-  CHECK(JS_GetProperty(cx, descObj, "get", &value));
-  CHECK(value.isUndefined());
-  CHECK(JS_GetProperty(cx, descObj, "set", &value));
-  CHECK(value.isUndefined());
-  CHECK(JS_GetProperty(cx, descObj, "writable", &value));
-  CHECK(value.isTrue());
-  CHECK(JS_GetProperty(cx, descObj, "configurable", &value));
-  CHECK(value.isTrue());
-  CHECK(JS_GetProperty(cx, descObj, "enumerable", &value));
-  CHECK(value.isTrue());
-
   CHECK(JS_GetPropertyDescriptor(cx, obj, "not-here", &desc));
   CHECK_EQUAL(desc.object(), nullptr);
 
   CHECK(JS_GetPropertyDescriptor(cx, obj, "toString", &desc));
   JS::RootedObject objectProto(cx, JS_GetObjectPrototype(cx, obj));
   CHECK(objectProto);
   CHECK_EQUAL(desc.object(), objectProto);
   CHECK(desc.value().isObject());
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -2841,26 +2841,16 @@ class MutableHandleBase<JS::PropertyDesc
 namespace JS {
 
 extern JS_PUBLIC_API(bool)
 ObjectToCompletePropertyDescriptor(JSContext* cx,
                                    JS::HandleObject obj,
                                    JS::HandleValue descriptor,
                                    JS::MutableHandle<PropertyDescriptor> desc);
 
-/*
- * ES6 draft rev 32 (2015 Feb 2) 6.2.4.4 FromPropertyDescriptor(Desc).
- *
- * If desc.object() is null, then vp is set to undefined.
- */
-extern JS_PUBLIC_API(bool)
-FromPropertyDescriptor(JSContext* cx,
-                       JS::Handle<JS::PropertyDescriptor> desc,
-                       JS::MutableHandleValue vp);
-
 } // namespace JS
 
 
 /*** Standard internal methods ********************************************************************
  *
  * The functions below are the fundamental operations on objects.
  *
  * ES6 specifies 14 internal methods that define how objects behave.  The
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -103,23 +103,19 @@ js::InformalValueTypeName(const Value& v
     if (v.isNull())
         return "null";
     if (v.isUndefined())
         return "undefined";
     return "value";
 }
 
 // ES6 draft rev37 6.2.4.4 FromPropertyDescriptor
-JS_PUBLIC_API(bool)
-JS::FromPropertyDescriptor(JSContext* cx, Handle<PropertyDescriptor> desc, MutableHandleValue vp)
+bool
+js::FromPropertyDescriptor(JSContext* cx, Handle<PropertyDescriptor> desc, MutableHandleValue vp)
 {
-    AssertHeapIsIdle(cx);
-    CHECK_REQUEST(cx);
-    assertSameCompartment(cx, desc);
-
     // Step 1.
     if (!desc.object()) {
         vp.setUndefined();
         return true;
     }
 
     return FromPropertyDescriptorToObject(cx, desc, vp);
 }
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -1236,20 +1236,28 @@ HasOwnDataPropertyPure(JSContext* cx, JS
 bool
 GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
                          MutableHandle<PropertyDescriptor> desc);
 
 bool
 GetOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id, MutableHandleValue vp);
 
 /*
- * Like JS::FromPropertyDescriptor, but ignore desc.object() and always set vp
+ * ES6 draft rev 32 (2015 Feb 2) 6.2.4.4 FromPropertyDescriptor(Desc).
+ *
+ * If desc.object() is null, then vp is set to undefined.
+ */
+extern bool
+FromPropertyDescriptor(JSContext* cx, Handle<PropertyDescriptor> desc, MutableHandleValue vp);
+
+/*
+ * Like FromPropertyDescriptor, but ignore desc.object() and always set vp
  * to an object on success.
  *
- * Use JS::FromPropertyDescriptor for getOwnPropertyDescriptor, since desc.object()
+ * Use FromPropertyDescriptor for getOwnPropertyDescriptor, since desc.object()
  * is used to indicate whether a result was found or not.  Use this instead for
  * defineProperty: it would be senseless to define a "missing" property.
  */
 extern bool
 FromPropertyDescriptorToObject(JSContext* cx, Handle<PropertyDescriptor> desc,
                                MutableHandleValue vp);
 
 extern bool
--- a/js/src/vm/Debugger.cpp
+++ b/js/src/vm/Debugger.cpp
@@ -8183,17 +8183,17 @@ DebuggerObject_getOwnPropertyDescriptor(
         if (desc.hasSetterObject()) {
             RootedValue set(cx, ObjectOrNullValue(desc.setterObject()));
             if (!dbg->wrapDebuggeeValue(cx, &set))
                 return false;
             desc.setSetterObject(set.toObjectOrNull());
         }
     }
 
-    return JS::FromPropertyDescriptor(cx, desc, args.rval());
+    return FromPropertyDescriptor(cx, desc, args.rval());
 }
 
 
 static bool
 getOwnPropertyKeys(JSContext* cx, unsigned argc, unsigned flags, Value* vp)
 {
     THIS_DEBUGOBJECT_REFERENT(cx, argc, vp, "getOwnPropertyKeys", args, obj);
     AutoIdVector keys(cx);