Bug 1206168 - Rename JS_DefaultValue to JS::ToPrimitive. r=jandem.

--HG--
extra : commitid : 4nCMAna0EKm
extra : rebase_source : b3590ed380216e2c1202b3773e7894702dc19a9e
This commit is contained in:
Jason Orendorff 2015-09-18 12:26:48 -05:00
Родитель 54e92d9beb
Коммит 5cfd64bf4d
3 изменённых файлов: 7 добавлений и 8 удалений

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

@ -2297,14 +2297,14 @@ NPObjectMember_toPrimitive(JSContext *cx, unsigned argc, JS::Value *vp)
if (!memberPrivate) if (!memberPrivate)
return false; return false;
JSType type; JSType hint;
if (!JS::GetFirstArgumentAsTypeHint(cx, args, &type)) if (!JS::GetFirstArgumentAsTypeHint(cx, args, &hint))
return false; return false;
args.rval().set(memberPrivate->fieldValue); args.rval().set(memberPrivate->fieldValue);
if (args.rval().isObject()) { if (args.rval().isObject()) {
JS::Rooted<JSObject*> objVal(cx, &args.rval().toObject()); 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; return true;
} }

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

@ -1803,7 +1803,7 @@ JS_IdToValue(JSContext* cx, jsid id, MutableHandleValue vp)
} }
JS_PUBLIC_API(bool) 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); AssertHeapIsIdle(cx);
CHECK_REQUEST(cx); CHECK_REQUEST(cx);

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

@ -1886,6 +1886,8 @@ JS_StringToId(JSContext* cx, JS::HandleString s, JS::MutableHandleId idp);
extern JS_PUBLIC_API(bool) extern JS_PUBLIC_API(bool)
JS_IdToValue(JSContext* cx, jsid id, JS::MutableHandle<JS::Value> vp); 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 * Convert obj to a primitive value. On success, store the result in vp and
* return true. * return true.
@ -1896,10 +1898,7 @@ JS_IdToValue(JSContext* cx, jsid id, JS::MutableHandle<JS::Value> vp);
* Implements: ES6 7.1.1 ToPrimitive(input, [PreferredType]). * Implements: ES6 7.1.1 ToPrimitive(input, [PreferredType]).
*/ */
extern JS_PUBLIC_API(bool) extern JS_PUBLIC_API(bool)
JS_DefaultValue(JSContext* cx, JS::HandleObject obj, JSType hint, ToPrimitive(JSContext* cx, JS::HandleObject obj, JSType hint, JS::MutableHandleValue vp);
JS::MutableHandleValue vp);
namespace JS {
/** /**
* If args.get(0) is one of the strings "string", "number", or "default", set * If args.get(0) is one of the strings "string", "number", or "default", set