This commit is contained in:
Chris Leary 2011-10-14 03:19:52 -07:00
Родитель 838539811c
Коммит caa8880c43
3 изменённых файлов: 5 добавлений и 5 удалений

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

@ -529,7 +529,7 @@ ExecuteRegExp(JSContext *cx, Native native, uintN argc, Value *vp)
RegExpStatics *res = cx->regExpStatics();
/* Step 2. */
JSString *input = js_ValueToString(cx, args.length() > 0 ? args[0] : UndefinedValue());
JSString *input = js_ValueToString(cx, (args.length() > 0) ? args[0] : UndefinedValue());
if (!input)
return false;
@ -558,7 +558,7 @@ ExecuteRegExp(JSContext *cx, Native native, uintN argc, Value *vp)
}
/* Steps 8-21. */
RegExpExecType execType = native == regexp_test ? RegExpTest : RegExpExec;
RegExpExecType execType = (native == regexp_test) ? RegExpTest : RegExpExec;
size_t lastIndexInt(i);
if (!ExecuteRegExp(cx, res, rep, linearInput, chars, length, &lastIndexInt, execType,
&args.rval())) {

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

@ -1449,7 +1449,7 @@ class RegExpGuard
static JS_ALWAYS_INLINE bool
Matched(RegExpExecType type, const Value &v)
{
return type == RegExpTest ? v.isTrue() : !v.isNull();
return (type == RegExpTest) ? v.isTrue() : !v.isNull();
}
typedef bool (*DoMatchCallback)(JSContext *cx, RegExpStatics *res, size_t count, void *data);
@ -1482,7 +1482,7 @@ DoMatch(JSContext *cx, RegExpStatics *res, JSString *str, const RegExpPair &regE
if (rep->global()) {
/* global matching ('g') */
RegExpExecType type = flags & TEST_GLOBAL_BIT ? RegExpTest : RegExpExec;
RegExpExecType type = (flags & TEST_GLOBAL_BIT) ? RegExpTest : RegExpExec;
if (RegExpObject *reobj = regExpPair.reobj())
reobj->zeroLastIndex();

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

@ -114,7 +114,7 @@ class MatchPairs
return;
for (int *it = buffer_; it < buffer_ + 2 * pairCount_; ++it)
*it = *it < 0 ? -1 : *it + amount;
*it = (*it < 0) ? -1 : *it + amount;
}
inline void checkAgainst(size_t length);