Bug 1448839: Remove unused native version of Object.defineProperty. r=till

--HG--
extra : rebase_source : fe9afb47142134c6195c120fae1822915aef3165
This commit is contained in:
André Bargull 2018-03-26 05:40:17 -07:00
Родитель d963ea0581
Коммит 07683220db
6 изменённых файлов: 10 добавлений и 55 удалений

Просмотреть файл

@ -1755,32 +1755,6 @@ obj_getOwnPropertySymbols(JSContext* cx, unsigned argc, Value* vp)
args.rval());
}
/* ES6 draft rev 32 (2015 Feb 2) 19.1.2.4: Object.defineProperty(O, P, Attributes) */
bool
js::obj_defineProperty(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
// Steps 1-3.
RootedObject obj(cx);
if (!GetFirstArgumentAsObject(cx, args, "Object.defineProperty", &obj))
return false;
RootedId id(cx);
if (!ToPropertyKey(cx, args.get(1), &id))
return false;
// Steps 4-5.
Rooted<PropertyDescriptor> desc(cx);
if (!ToPropertyDescriptor(cx, args.get(2), true, &desc))
return false;
// Steps 6-8.
if (!DefineProperty(cx, obj, id, desc))
return false;
args.rval().setObject(*obj);
return true;
}
/* ES5 15.2.3.7: Object.defineProperties(O, Properties) */
static bool
obj_defineProperties(JSContext* cx, unsigned argc, Value* vp)

Просмотреть файл

@ -22,9 +22,6 @@ namespace js {
MOZ_MUST_USE bool
obj_construct(JSContext* cx, unsigned argc, JS::Value* vp);
MOZ_MUST_USE bool
obj_propertyIsEnumerable(JSContext* cx, unsigned argc, Value* vp);
PlainObject*
ObjectCreateImpl(JSContext* cx, HandleObject proto, NewObjectKind newKind = GenericObject,
HandleObjectGroup group = nullptr);
@ -33,29 +30,21 @@ PlainObject*
ObjectCreateWithTemplate(JSContext* cx, HandlePlainObject templateObj);
// Object methods exposed so they can be installed in the self-hosting global.
MOZ_MUST_USE bool
obj_propertyIsEnumerable(JSContext* cx, unsigned argc, Value* vp);
MOZ_MUST_USE bool
obj_create(JSContext* cx, unsigned argc, JS::Value* vp);
MOZ_MUST_USE bool
obj_defineProperty(JSContext* cx, unsigned argc, JS::Value* vp);
MOZ_MUST_USE bool
obj_getOwnPropertyNames(JSContext* cx, unsigned argc, JS::Value* vp);
MOZ_MUST_USE bool
obj_getPrototypeOf(JSContext* cx, unsigned argc, JS::Value* vp);
MOZ_MUST_USE bool
obj_isExtensible(JSContext* cx, unsigned argc, JS::Value* vp);
MOZ_MUST_USE bool
obj_toString(JSContext* cx, unsigned argc, JS::Value* vp);
JSString*
ObjectClassToString(JSContext* cx, HandleObject obj);
// Exposed so SelfHosting.cpp can use it in the OwnPropertyKeys intrinsic
MOZ_MUST_USE bool
GetOwnPropertyKeys(JSContext* cx, HandleObject obj, unsigned flags, JS::MutableHandleValue rval);

Просмотреть файл

@ -8,7 +8,7 @@ function ObjectGetOwnPropertyDescriptors(O) {
var obj = ToObject(O);
// Step 2.
var keys = OwnPropertyKeys(obj);
var keys = std_Reflect_ownKeys(obj);
// Step 3.
var descriptors = {};

Просмотреть файл

@ -87,8 +87,8 @@ js::Reflect_isExtensible(JSContext* cx, unsigned argc, Value* vp)
// ES2018 draft rev c164be80f7ea91de5526b33d54e5c9321ed03d3f
// 26.1.10 Reflect.ownKeys ( target )
static bool
Reflect_ownKeys(JSContext* cx, unsigned argc, Value* vp)
bool
js::Reflect_ownKeys(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);

Просмотреть файл

@ -24,6 +24,9 @@ Reflect_getPrototypeOf(JSContext* cx, unsigned argc, Value* vp);
extern MOZ_MUST_USE bool
Reflect_isExtensible(JSContext* cx, unsigned argc, Value* vp);
extern MOZ_MUST_USE bool
Reflect_ownKeys(JSContext* cx, unsigned argc, Value* vp);
}
#endif /* builtin_Reflect_h */

Просмотреть файл

@ -262,17 +262,6 @@ intrinsic_SubstringKernel(JSContext* cx, unsigned argc, Value* vp)
return true;
}
static bool
intrinsic_OwnPropertyKeys(JSContext* cx, unsigned argc, Value* vp)
{
CallArgs args = CallArgsFromVp(argc, vp);
MOZ_ASSERT(args.length() == 1);
MOZ_ASSERT(args[0].isObject());
RootedObject obj(cx, &args[0].toObject());
return GetOwnPropertyKeys(cx, obj, JSITER_OWNONLY | JSITER_HIDDEN | JSITER_SYMBOLS,
args.rval());
}
static void
ThrowErrorWithType(JSContext* cx, JSExnType type, const CallArgs& args)
{
@ -2258,6 +2247,7 @@ static const JSFunctionSpec intrinsic_functions[] = {
JS_INLINABLE_FN("std_Reflect_getPrototypeOf", Reflect_getPrototypeOf, 1,0,
ReflectGetPrototypeOf),
JS_FN("std_Reflect_isExtensible", Reflect_isExtensible, 1,0),
JS_FN("std_Reflect_ownKeys", Reflect_ownKeys, 1,0),
JS_FN("std_Set_has", SetObject::has, 1,0),
JS_FN("std_Set_iterator", SetObject::values, 0,0),
@ -2325,7 +2315,6 @@ static const JSFunctionSpec intrinsic_functions[] = {
JS_FN("CreateModuleSyntaxError", intrinsic_CreateModuleSyntaxError, 4,0),
JS_FN("AssertionFailed", intrinsic_AssertionFailed, 1,0),
JS_FN("DumpMessage", intrinsic_DumpMessage, 1,0),
JS_FN("OwnPropertyKeys", intrinsic_OwnPropertyKeys, 1,0),
JS_FN("MakeDefaultConstructor", intrinsic_MakeDefaultConstructor, 2,0),
JS_FN("_ConstructorForTypedArray", intrinsic_ConstructorForTypedArray, 1,0),
JS_FN("_NameForTypedArray", intrinsic_NameForTypedArray, 1,0),