Commit 23881387 authored by Chris Peterson's avatar Chris Peterson
Browse files

Bug 977445 - Remove unused JSContext parameter from BooleanToStringBuffer() and friends. r=luke

parent f29b18d0
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -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 {
+2 −2
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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 */

+3 −3
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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));
        }
    }

Loading