mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1206168 - Rename JS_DefaultValue to JS::ToPrimitive. r=jandem.
This commit is contained in:
parent
1323fdffb9
commit
25aecec3e7
@ -2297,14 +2297,14 @@ NPObjectMember_toPrimitive(JSContext *cx, unsigned argc, JS::Value *vp)
|
||||
if (!memberPrivate)
|
||||
return false;
|
||||
|
||||
JSType type;
|
||||
if (!JS::GetFirstArgumentAsTypeHint(cx, args, &type))
|
||||
JSType hint;
|
||||
if (!JS::GetFirstArgumentAsTypeHint(cx, args, &hint))
|
||||
return false;
|
||||
|
||||
args.rval().set(memberPrivate->fieldValue);
|
||||
if (args.rval().isObject()) {
|
||||
JS::Rooted<JSObject*> objVal(cx, &args.rval().toObject());
|
||||
return JS_DefaultValue(cx, objVal, type, args.rval());
|
||||
return JS::ToPrimitive(cx, objVal, hint, args.rval());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -1802,7 +1802,7 @@ JS_IdToValue(JSContext* cx, jsid id, MutableHandleValue vp)
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(bool)
|
||||
JS_DefaultValue(JSContext* cx, HandleObject obj, JSType hint, MutableHandleValue vp)
|
||||
JS::ToPrimitive(JSContext* cx, HandleObject obj, JSType hint, MutableHandleValue vp)
|
||||
{
|
||||
AssertHeapIsIdle(cx);
|
||||
CHECK_REQUEST(cx);
|
||||
|
@ -1898,6 +1898,8 @@ JS_StringToId(JSContext* cx, JS::HandleString s, JS::MutableHandleId idp);
|
||||
extern JS_PUBLIC_API(bool)
|
||||
JS_IdToValue(JSContext* cx, jsid id, JS::MutableHandle<JS::Value> vp);
|
||||
|
||||
namespace JS {
|
||||
|
||||
/**
|
||||
* Convert obj to a primitive value. On success, store the result in vp and
|
||||
* return true.
|
||||
@ -1908,10 +1910,7 @@ JS_IdToValue(JSContext* cx, jsid id, JS::MutableHandle<JS::Value> vp);
|
||||
* Implements: ES6 7.1.1 ToPrimitive(input, [PreferredType]).
|
||||
*/
|
||||
extern JS_PUBLIC_API(bool)
|
||||
JS_DefaultValue(JSContext* cx, JS::HandleObject obj, JSType hint,
|
||||
JS::MutableHandleValue vp);
|
||||
|
||||
namespace JS {
|
||||
ToPrimitive(JSContext* cx, JS::HandleObject obj, JSType hint, JS::MutableHandleValue vp);
|
||||
|
||||
/**
|
||||
* If args.get(0) is one of the strings "string", "number", or "default", set
|
||||
|
Loading…
Reference in New Issue
Block a user