C = (jschar)V;
c = (jschar)v;
Decode(JSContext *cx, JSString *str, const jschar *reservedSet, jsval *rval){    size_t length, start, k;    jschar *chars, C, H;    uint32 V;    jsuint B;    uint8 octets[6];    JSString *R;    intN j, n;    length = JSSTRING_LENGTH(str);    if (length == 0) {        *rval = STRING_TO_JSVAL(cx->runtime->emptyString);        return JS_TRUE;    }    R = js_NewString(cx, NULL, 0, 0);    if (!R)        return JS_FALSE;    chars = JSSTRING_CHARS(str);    for (k = 0; k < length; k++) {        C = chars[k];        if (C == '%') {            start = k;            if ((k + 2) >= length)                goto bad;            if (!JS7_ISHEX(chars[k+1]) || !JS7_ISHEX(chars[k+2]))                goto bad;            B = JS7_UNHEX(chars[k+1]) * 16 + JS7_UNHEX(chars[k+2]);            k += 2;            if (!(B & 0x80)) {                C = (jschar)B;            } else {                n = 1;                while (B & (0x80 >> n))                    n++;                if (n == 1 || n > 6)                    goto bad;                octets[0] = (uint8)B;                if (k + 3 * (n - 1) >= length)                    goto bad;                for (j = 1; j < n; j++) {                    k++;                    if (chars[k] != '%')                        goto bad;                    if (!JS7_ISHEX(chars[k+1]) || !JS7_ISHEX(chars[k+2]))                        goto bad;                    B = JS7_UNHEX(chars[k+1]) * 16 + JS7_UNHEX(chars[k+2]);                    if ((B & 0xC0) != 0x80)                        goto bad;                    k += 2;                    octets[j] = (char)B;                }                V = Utf8ToOneUcs4Char(octets, n);                if (V >= 0x10000) {                    V -= 0x10000;                    if (V > 0xFFFFF)                        goto bad;                    C = (jschar)((V & 0x3FF) + 0xDC00);                    H = (jschar)((V >> 10) + 0xD800);                    if (!AddCharsToURI(cx, R, &H, 1))                        return JS_FALSE;                } else {                    C = (jschar)V;                }            }            if (js_strchr(reservedSet, C)) {                if (!AddCharsToURI(cx, R, &chars[start], (k - start + 1)))                    return JS_FALSE;            } else {                if (!AddCharsToURI(cx, R, &C, 1))                    return JS_FALSE;            }        } else {            if (!AddCharsToURI(cx, R, &C, 1))                return JS_FALSE;        }    }    /*     * Shrinking realloc can fail (e.g., with a BSD-style allocator), but we     * don't worry about that case here.  Worst case, R hangs onto URI_CHUNK-1     * more jschars than it needs.     */    chars = (jschar *) JS_realloc(cx, R->chars, (R->length+1) * sizeof(jschar));    if (chars)        R->chars = chars;    *rval = STRING_TO_JSVAL(R);    return JS_TRUE;bad:    JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_URI);    return JS_FALSE;}