зеркало из https://github.com/mozilla/gecko-dev.git
Bug 977445 - Remove unused JSContext parameter from BooleanToStringBuffer() and friends. r=luke
This commit is contained in:
Родитель
f29b18d0c0
Коммит
23881387bb
|
@ -998,7 +998,7 @@ ArrayJoinKernel(JSContext *cx, SeparatorOp sepOp, HandleObject obj, uint32_t len
|
|||
if (!NumberValueToStringBuffer(cx, elem, sb))
|
||||
return false;
|
||||
} else if (elem.isBoolean()) {
|
||||
if (!BooleanToStringBuffer(cx, elem.toBoolean(), sb))
|
||||
if (!BooleanToStringBuffer(elem.toBoolean(), sb))
|
||||
return false;
|
||||
} else if (elem.isObject()) {
|
||||
/*
|
||||
|
@ -1431,7 +1431,7 @@ NumDigitsBase10(uint32_t n)
|
|||
}
|
||||
|
||||
static inline bool
|
||||
CompareLexicographicInt32(JSContext *cx, const Value &a, const Value &b, bool *lessOrEqualp)
|
||||
CompareLexicographicInt32(const Value &a, const Value &b, bool *lessOrEqualp)
|
||||
{
|
||||
int32_t aint = a.toInt32();
|
||||
int32_t bint = b.toInt32();
|
||||
|
@ -1504,13 +1504,8 @@ struct SortComparatorStrings
|
|||
|
||||
struct SortComparatorLexicographicInt32
|
||||
{
|
||||
JSContext *const cx;
|
||||
|
||||
SortComparatorLexicographicInt32(JSContext *cx)
|
||||
: cx(cx) {}
|
||||
|
||||
bool operator()(const Value &a, const Value &b, bool *lessOrEqualp) {
|
||||
return CompareLexicographicInt32(cx, a, b, lessOrEqualp);
|
||||
return CompareLexicographicInt32(a, b, lessOrEqualp);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1940,7 +1935,7 @@ js::array_sort(JSContext *cx, unsigned argc, Value *vp)
|
|||
} else if (allInts) {
|
||||
JS_ALWAYS_TRUE(vec.resize(n * 2));
|
||||
if (!MergeSort(vec.begin(), n, vec.begin() + n,
|
||||
SortComparatorLexicographicInt32(cx))) {
|
||||
SortComparatorLexicographicInt32())) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -53,7 +53,7 @@ bool_toSource_impl(JSContext *cx, CallArgs args)
|
|||
bool b = thisv.isBoolean() ? thisv.toBoolean() : thisv.toObject().as<BooleanObject>().unbox();
|
||||
|
||||
StringBuffer sb(cx);
|
||||
if (!sb.append("(new Boolean(") || !BooleanToStringBuffer(cx, b, sb) || !sb.append("))"))
|
||||
if (!sb.append("(new Boolean(") || !BooleanToStringBuffer(b, sb) || !sb.append("))"))
|
||||
return false;
|
||||
|
||||
JSString *str = sb.finishString();
|
||||
|
@ -196,7 +196,7 @@ js::ToBooleanSlow(HandleValue v)
|
|||
* The only caller of the fast path, JSON's PreprocessValue, ensures that.
|
||||
*/
|
||||
bool
|
||||
js::BooleanGetPrimitiveValueSlow(HandleObject wrappedBool, JSContext *cx)
|
||||
js::BooleanGetPrimitiveValueSlow(HandleObject wrappedBool)
|
||||
{
|
||||
JSObject *obj = wrappedBool->as<ProxyObject>().target();
|
||||
JS_ASSERT(obj);
|
||||
|
|
|
@ -22,7 +22,7 @@ js_BooleanToString(js::ExclusiveContext *cx, bool b);
|
|||
namespace js {
|
||||
|
||||
inline bool
|
||||
BooleanGetPrimitiveValue(HandleObject obj, JSContext *cx);
|
||||
BooleanGetPrimitiveValue(HandleObject obj);
|
||||
|
||||
} /* namespace js */
|
||||
|
||||
|
|
|
@ -15,15 +15,15 @@
|
|||
namespace js {
|
||||
|
||||
bool
|
||||
BooleanGetPrimitiveValueSlow(HandleObject, JSContext *);
|
||||
BooleanGetPrimitiveValueSlow(HandleObject);
|
||||
|
||||
inline bool
|
||||
BooleanGetPrimitiveValue(HandleObject obj, JSContext *cx)
|
||||
BooleanGetPrimitiveValue(HandleObject obj)
|
||||
{
|
||||
if (obj->is<BooleanObject>())
|
||||
return obj->as<BooleanObject>().unbox();
|
||||
|
||||
return BooleanGetPrimitiveValueSlow(obj, cx);
|
||||
return BooleanGetPrimitiveValueSlow(obj);
|
||||
}
|
||||
|
||||
inline bool
|
||||
|
|
|
@ -250,7 +250,7 @@ PreprocessValue(JSContext *cx, HandleObject holder, KeyType key, MutableHandleVa
|
|||
return false;
|
||||
vp.set(StringValue(str));
|
||||
} else if (ObjectClassIs(obj, ESClass_Boolean, cx)) {
|
||||
vp.setBoolean(BooleanGetPrimitiveValue(obj, cx));
|
||||
vp.setBoolean(BooleanGetPrimitiveValue(obj));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ js::ValueToStringBufferSlow(JSContext *cx, const Value &arg, StringBuffer &sb)
|
|||
if (v.isNumber())
|
||||
return NumberValueToStringBuffer(cx, v, sb);
|
||||
if (v.isBoolean())
|
||||
return BooleanToStringBuffer(cx, v.toBoolean(), sb);
|
||||
return BooleanToStringBuffer(v.toBoolean(), sb);
|
||||
if (v.isNull())
|
||||
return sb.append(cx->names().null);
|
||||
JS_ASSERT(v.isUndefined());
|
||||
|
|
|
@ -141,7 +141,7 @@ ValueToStringBuffer(JSContext *cx, const Value &v, StringBuffer &sb)
|
|||
|
||||
/* ES5 9.8 ToString for booleans, appending the result to the string buffer. */
|
||||
inline bool
|
||||
BooleanToStringBuffer(JSContext *cx, bool b, StringBuffer &sb)
|
||||
BooleanToStringBuffer(bool b, StringBuffer &sb)
|
||||
{
|
||||
return b ? sb.append("true") : sb.append("false");
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче