Bug 1246318 - Remove the still disabled Reflect.enumerate code. r=efaust
authorTom Schuster <evilpies@gmail.com>
Thu, 11 Feb 2016 22:23:13 +0100
changeset 284032 be82a484968d
parent 284031 b2b9363f3edc
child 284033 32be2fe53fcd
push id29995
push usercbook@mozilla.com
push dateFri, 12 Feb 2016 14:16:12 +0000
treeherdermozilla-central@218d16a9ddcc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersefaust
bugs1246318
milestone47.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 1246318 - Remove the still disabled Reflect.enumerate code. r=efaust
js/src/builtin/Reflect.cpp
js/src/jsiter.cpp
js/src/tests/ecma_6/Reflect/surfaces.js
js/src/tests/ecma_6/Reflect/target.js
--- a/js/src/builtin/Reflect.cpp
+++ b/js/src/builtin/Reflect.cpp
@@ -172,43 +172,16 @@ Reflect_deleteProperty(JSContext* cx, un
     // Step 4.
     ObjectOpResult result;
     if (!DeleteProperty(cx, target, key, result))
         return false;
     args.rval().setBoolean(bool(result));
     return true;
 }
 
-#if 0
-/*
- * ES6 26.1.5 Reflect.enumerate(target)
- *
- * TODO:
- * - redefine enumeration in terms of iterators without losing performance
- * - support iterators in Proxies
- */
-static bool
-Reflect_enumerate(JSContext* cx, unsigned argc, Value* vp)
-{
-    CallArgs args = CallArgsFromVp(argc, vp);
-
-    // Step 1.
-    RootedObject obj(cx, NonNullObject(cx, args.get(0)));
-    if (!obj)
-        return false;
-
-    // Step 2.
-    RootedObject iterator(cx);
-    if (!Enumerate(cx, obj, &iterator))
-        return false;
-    args.rval().setObject(*iterator);
-    return true;
-}
-#endif
-
 /* ES6 26.1.6 Reflect.get(target, propertyKey [, receiver]) */
 static bool
 Reflect_get(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
     // Step 1.
     RootedObject obj(cx, NonNullObject(cx, args.get(0)));
@@ -375,17 +348,16 @@ Reflect_setPrototypeOf(JSContext* cx, un
     return true;
 }
 
 static const JSFunctionSpec methods[] = {
     JS_FN("apply", Reflect_apply, 3, 0),
     JS_FN("construct", Reflect_construct, 2, 0),
     JS_FN("defineProperty", Reflect_defineProperty, 3, 0),
     JS_FN("deleteProperty", Reflect_deleteProperty, 2, 0),
-    // JS_FN("enumerate", Reflect_enumerate, 1, 0),
     JS_FN("get", Reflect_get, 2, 0),
     JS_FN("getOwnPropertyDescriptor", Reflect_getOwnPropertyDescriptor, 2, 0),
     JS_FN("getPrototypeOf", Reflect_getPrototypeOf, 1, 0),
     JS_SELF_HOSTED_FN("has", "Reflect_has", 2, 0),
     JS_FN("isExtensible", Reflect_isExtensible, 1, 0),
     JS_FN("ownKeys", Reflect_ownKeys, 1, 0),
     JS_FN("preventExtensions", Reflect_preventExtensions, 1, 0),
     JS_FN("set", Reflect_set, 3, 0),
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -799,17 +799,16 @@ js::GetIterator(JSContext* cx, HandleObj
 {
     if (obj->is<PropertyIteratorObject>() || obj->is<LegacyGeneratorObject>()) {
         objp.set(obj);
         return true;
     }
 
     // We should only call the enumerate trap for "for-in".
     // Or when we call GetIterator from the Proxy [[Enumerate]] hook.
-    // In the future also for Reflect.enumerate.
     // JSITER_ENUMERATE is just an optimization and the same
     // as flags == 0 otherwise.
     if (flags == 0 || flags == JSITER_ENUMERATE) {
         if (obj->is<ProxyObject>())
             return Proxy::enumerate(cx, obj, objp);
     }
 
     Vector<ReceiverGuard, 8> guards(cx);
--- a/js/src/tests/ecma_6/Reflect/surfaces.js
+++ b/js/src/tests/ecma_6/Reflect/surfaces.js
@@ -16,17 +16,16 @@ for (var name in Reflect)
     throw new Error("Reflect should not have any enumerable properties");
 
 // The name and length of all the standard Reflect methods.
 var methods = {
     apply: 3,
     construct: 2,
     defineProperty: 3,
     deleteProperty: 2,
-    //enumerate: 1,
     get: 2,
     getOwnPropertyDescriptor: 2,
     getPrototypeOf: 1,
     has: 2,
     isExtensible: 1,
     ownKeys: 1,
     preventExtensions: 1,
     set: 3,
--- a/js/src/tests/ecma_6/Reflect/target.js
+++ b/js/src/tests/ecma_6/Reflect/target.js
@@ -5,17 +5,16 @@
 
 // For each standard Reflect method, an array of arguments
 // that would be OK after a suitable target argument.
 var methodInfo = {
     apply: [undefined, []],
     construct: [[]],
     defineProperty: ["x", {}],
     deleteProperty: ["x"],
-    //enumerate: [],
     get: ["x", {}],
     getOwnPropertyDescriptor: ["x"],
     getPrototypeOf: [],
     has: ["x"],
     isExtensible: [],
     ownKeys: [],
     preventExtensions: [],
     set: ["x", 0],