mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Bug 977445 - Remove unused JSContext parameter from BooleanToStringBuffer() and friends. r=luke
This commit is contained in:
parent
f29b18d0c0
commit
23881387bb
@ -998,7 +998,7 @@ ArrayJoinKernel(JSContext *cx, SeparatorOp sepOp, HandleObject obj, uint32_t len
|
|||||||
if (!NumberValueToStringBuffer(cx, elem, sb))
|
if (!NumberValueToStringBuffer(cx, elem, sb))
|
||||||
return false;
|
return false;
|
||||||
} else if (elem.isBoolean()) {
|
} else if (elem.isBoolean()) {
|
||||||
if (!BooleanToStringBuffer(cx, elem.toBoolean(), sb))
|
if (!BooleanToStringBuffer(elem.toBoolean(), sb))
|
||||||
return false;
|
return false;
|
||||||
} else if (elem.isObject()) {
|
} else if (elem.isObject()) {
|
||||||
/*
|
/*
|
||||||
@ -1431,7 +1431,7 @@ NumDigitsBase10(uint32_t n)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static inline bool
|
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 aint = a.toInt32();
|
||||||
int32_t bint = b.toInt32();
|
int32_t bint = b.toInt32();
|
||||||
@ -1504,13 +1504,8 @@ struct SortComparatorStrings
|
|||||||
|
|
||||||
struct SortComparatorLexicographicInt32
|
struct SortComparatorLexicographicInt32
|
||||||
{
|
{
|
||||||
JSContext *const cx;
|
|
||||||
|
|
||||||
SortComparatorLexicographicInt32(JSContext *cx)
|
|
||||||
: cx(cx) {}
|
|
||||||
|
|
||||||
bool operator()(const Value &a, const Value &b, bool *lessOrEqualp) {
|
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) {
|
} else if (allInts) {
|
||||||
JS_ALWAYS_TRUE(vec.resize(n * 2));
|
JS_ALWAYS_TRUE(vec.resize(n * 2));
|
||||||
if (!MergeSort(vec.begin(), n, vec.begin() + n,
|
if (!MergeSort(vec.begin(), n, vec.begin() + n,
|
||||||
SortComparatorLexicographicInt32(cx))) {
|
SortComparatorLexicographicInt32())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -53,7 +53,7 @@ bool_toSource_impl(JSContext *cx, CallArgs args)
|
|||||||
bool b = thisv.isBoolean() ? thisv.toBoolean() : thisv.toObject().as<BooleanObject>().unbox();
|
bool b = thisv.isBoolean() ? thisv.toBoolean() : thisv.toObject().as<BooleanObject>().unbox();
|
||||||
|
|
||||||
StringBuffer sb(cx);
|
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;
|
return false;
|
||||||
|
|
||||||
JSString *str = sb.finishString();
|
JSString *str = sb.finishString();
|
||||||
@ -196,7 +196,7 @@ js::ToBooleanSlow(HandleValue v)
|
|||||||
* The only caller of the fast path, JSON's PreprocessValue, ensures that.
|
* The only caller of the fast path, JSON's PreprocessValue, ensures that.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
js::BooleanGetPrimitiveValueSlow(HandleObject wrappedBool, JSContext *cx)
|
js::BooleanGetPrimitiveValueSlow(HandleObject wrappedBool)
|
||||||
{
|
{
|
||||||
JSObject *obj = wrappedBool->as<ProxyObject>().target();
|
JSObject *obj = wrappedBool->as<ProxyObject>().target();
|
||||||
JS_ASSERT(obj);
|
JS_ASSERT(obj);
|
||||||
|
@ -22,7 +22,7 @@ js_BooleanToString(js::ExclusiveContext *cx, bool b);
|
|||||||
namespace js {
|
namespace js {
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
BooleanGetPrimitiveValue(HandleObject obj, JSContext *cx);
|
BooleanGetPrimitiveValue(HandleObject obj);
|
||||||
|
|
||||||
} /* namespace js */
|
} /* namespace js */
|
||||||
|
|
||||||
|
@ -15,15 +15,15 @@
|
|||||||
namespace js {
|
namespace js {
|
||||||
|
|
||||||
bool
|
bool
|
||||||
BooleanGetPrimitiveValueSlow(HandleObject, JSContext *);
|
BooleanGetPrimitiveValueSlow(HandleObject);
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
BooleanGetPrimitiveValue(HandleObject obj, JSContext *cx)
|
BooleanGetPrimitiveValue(HandleObject obj)
|
||||||
{
|
{
|
||||||
if (obj->is<BooleanObject>())
|
if (obj->is<BooleanObject>())
|
||||||
return obj->as<BooleanObject>().unbox();
|
return obj->as<BooleanObject>().unbox();
|
||||||
|
|
||||||
return BooleanGetPrimitiveValueSlow(obj, cx);
|
return BooleanGetPrimitiveValueSlow(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
|
@ -250,7 +250,7 @@ PreprocessValue(JSContext *cx, HandleObject holder, KeyType key, MutableHandleVa
|
|||||||
return false;
|
return false;
|
||||||
vp.set(StringValue(str));
|
vp.set(StringValue(str));
|
||||||
} else if (ObjectClassIs(obj, ESClass_Boolean, cx)) {
|
} 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())
|
if (v.isNumber())
|
||||||
return NumberValueToStringBuffer(cx, v, sb);
|
return NumberValueToStringBuffer(cx, v, sb);
|
||||||
if (v.isBoolean())
|
if (v.isBoolean())
|
||||||
return BooleanToStringBuffer(cx, v.toBoolean(), sb);
|
return BooleanToStringBuffer(v.toBoolean(), sb);
|
||||||
if (v.isNull())
|
if (v.isNull())
|
||||||
return sb.append(cx->names().null);
|
return sb.append(cx->names().null);
|
||||||
JS_ASSERT(v.isUndefined());
|
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. */
|
/* ES5 9.8 ToString for booleans, appending the result to the string buffer. */
|
||||||
inline bool
|
inline bool
|
||||||
BooleanToStringBuffer(JSContext *cx, bool b, StringBuffer &sb)
|
BooleanToStringBuffer(bool b, StringBuffer &sb)
|
||||||
{
|
{
|
||||||
return b ? sb.append("true") : sb.append("false");
|
return b ? sb.append("true") : sb.append("false");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user