mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 12:51:06 +00:00
Bug 1849238 - Improve and rename JS::ObjectToCompletePropertyDescriptor. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D186504
This commit is contained in:
parent
e7dae1d581
commit
3d1f26d276
@ -480,8 +480,13 @@ extern JS_PUBLIC_API bool JS_GetUCPropertyDescriptor(
|
|||||||
|
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
extern JS_PUBLIC_API bool ObjectToCompletePropertyDescriptor(
|
// https://tc39.es/ecma262/#sec-topropertydescriptor
|
||||||
JSContext* cx, Handle<JSObject*> obj, Handle<Value> descriptor,
|
// https://tc39.es/ecma262/#sec-completepropertydescriptor
|
||||||
|
//
|
||||||
|
// Implements ToPropertyDescriptor combined with CompletePropertyDescriptor,
|
||||||
|
// if the former is successful.
|
||||||
|
extern JS_PUBLIC_API bool ToCompletePropertyDescriptor(
|
||||||
|
JSContext* cx, Handle<Value> descriptor,
|
||||||
MutableHandle<PropertyDescriptor> desc);
|
MutableHandle<PropertyDescriptor> desc);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2042,13 +2042,13 @@ JS_PUBLIC_API bool JS::PropertySpecNameToPermanentId(JSContext* cx,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
JS_PUBLIC_API bool JS::ObjectToCompletePropertyDescriptor(
|
JS_PUBLIC_API bool JS::ToCompletePropertyDescriptor(
|
||||||
JSContext* cx, HandleObject obj, HandleValue descObj,
|
JSContext* cx, HandleValue descriptor,
|
||||||
MutableHandle<PropertyDescriptor> desc) {
|
MutableHandle<PropertyDescriptor> desc) {
|
||||||
// |obj| can be in a different compartment here. The caller is responsible
|
AssertHeapIsIdle();
|
||||||
// for wrapping it (see JS_WrapPropertyDescriptor).
|
CHECK_THREAD(cx);
|
||||||
cx->check(descObj);
|
cx->check(descriptor);
|
||||||
if (!ToPropertyDescriptor(cx, descObj, true, desc)) {
|
if (!ToPropertyDescriptor(cx, descriptor, /* checkAccessors */ true, desc)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
CompletePropertyDescriptor(desc);
|
CompletePropertyDescriptor(desc);
|
||||||
|
Loading…
Reference in New Issue
Block a user