зеркало из https://github.com/mozilla/pjs.git
Bug 607148 - Remove unnamed namespaces from SpiderMonkey code. rs=luke
This commit is contained in:
Родитель
3e3f5c8a0b
Коммит
00b72e1cb0
|
@ -912,9 +912,7 @@ array_trace(JSTracer *trc, JSObject *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
static JSBool
|
||||||
|
|
||||||
JSBool
|
|
||||||
array_fix(JSContext *cx, JSObject *obj, bool *success, AutoIdVector *props)
|
array_fix(JSContext *cx, JSObject *obj, bool *success, AutoIdVector *props)
|
||||||
{
|
{
|
||||||
JS_ASSERT(obj->isDenseArray());
|
JS_ASSERT(obj->isDenseArray());
|
||||||
|
@ -931,8 +929,6 @@ array_fix(JSContext *cx, JSObject *obj, bool *success, AutoIdVector *props)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
Class js_ArrayClass = {
|
Class js_ArrayClass = {
|
||||||
"Array",
|
"Array",
|
||||||
Class::NON_NATIVE |
|
Class::NON_NATIVE |
|
||||||
|
|
|
@ -2019,10 +2019,8 @@ date_toISOString(JSContext *cx, uintN argc, Value *vp)
|
||||||
return date_utc_format(cx, vp, print_iso_string);
|
return date_utc_format(cx, vp, print_iso_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
/* ES5 15.9.5.44. */
|
/* ES5 15.9.5.44. */
|
||||||
JSBool
|
static JSBool
|
||||||
date_toJSON(JSContext *cx, uintN argc, Value *vp)
|
date_toJSON(JSContext *cx, uintN argc, Value *vp)
|
||||||
{
|
{
|
||||||
/* Step 1. */
|
/* Step 1. */
|
||||||
|
@ -2068,8 +2066,6 @@ date_toJSON(JSContext *cx, uintN argc, Value *vp)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* for Date.toLocaleString; interface to PRMJTime date struct.
|
/* for Date.toLocaleString; interface to PRMJTime date struct.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -259,8 +259,6 @@ GetStackTraceValueBuffer(JSExnPrivate *priv)
|
||||||
return (jsval *)(priv->stackElems + priv->stackDepth);
|
return (jsval *)(priv->stackElems + priv->stackDepth);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
struct CopyTo
|
struct CopyTo
|
||||||
{
|
{
|
||||||
Value *dst;
|
Value *dst;
|
||||||
|
@ -270,8 +268,6 @@ struct CopyTo
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSBool
|
static JSBool
|
||||||
InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message,
|
InitExnPrivate(JSContext *cx, JSObject *exnObject, JSString *message,
|
||||||
JSString *filename, uintN lineno, JSErrorReport *report)
|
JSString *filename, uintN lineno, JSErrorReport *report)
|
||||||
|
|
|
@ -209,8 +209,6 @@ NewArguments(JSContext *cx, JSObject *parent, uint32 argc, JSObject &callee)
|
||||||
return argsobj;
|
return argsobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
struct STATIC_SKIP_INFERENCE PutArg
|
struct STATIC_SKIP_INFERENCE PutArg
|
||||||
{
|
{
|
||||||
PutArg(Value *dst) : dst(dst) {}
|
PutArg(Value *dst) : dst(dst) {}
|
||||||
|
@ -222,8 +220,6 @@ struct STATIC_SKIP_INFERENCE PutArg
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
JSObject *
|
JSObject *
|
||||||
js_GetArgsObject(JSContext *cx, JSStackFrame *fp)
|
js_GetArgsObject(JSContext *cx, JSStackFrame *fp)
|
||||||
{
|
{
|
||||||
|
@ -651,9 +647,7 @@ args_enumerate(JSContext *cx, JSObject *obj)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
static JSBool
|
||||||
|
|
||||||
JSBool
|
|
||||||
StrictArgGetter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
|
StrictArgGetter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
|
||||||
{
|
{
|
||||||
LeaveTrace(cx);
|
LeaveTrace(cx);
|
||||||
|
@ -680,7 +674,7 @@ StrictArgGetter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSBool
|
static JSBool
|
||||||
StrictArgSetter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
|
StrictArgSetter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
|
||||||
{
|
{
|
||||||
if (!InstanceOf(cx, obj, &StrictArgumentsClass, NULL))
|
if (!InstanceOf(cx, obj, &StrictArgumentsClass, NULL))
|
||||||
|
@ -707,7 +701,7 @@ StrictArgSetter(JSContext *cx, JSObject *obj, jsid id, Value *vp)
|
||||||
js_SetProperty(cx, obj, id, vp, true);
|
js_SetProperty(cx, obj, id, vp, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSBool
|
static JSBool
|
||||||
strictargs_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, JSObject **objp)
|
strictargs_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, JSObject **objp)
|
||||||
{
|
{
|
||||||
JS_ASSERT(obj->isStrictArguments());
|
JS_ASSERT(obj->isStrictArguments());
|
||||||
|
@ -757,7 +751,7 @@ strictargs_resolve(JSContext *cx, JSObject *obj, jsid id, uintN flags, JSObject
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSBool
|
static JSBool
|
||||||
strictargs_enumerate(JSContext *cx, JSObject *obj)
|
strictargs_enumerate(JSContext *cx, JSObject *obj)
|
||||||
{
|
{
|
||||||
JS_ASSERT(obj->isStrictArguments());
|
JS_ASSERT(obj->isStrictArguments());
|
||||||
|
@ -789,8 +783,6 @@ strictargs_enumerate(JSContext *cx, JSObject *obj)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
args_finalize(JSContext *cx, JSObject *obj)
|
args_finalize(JSContext *cx, JSObject *obj)
|
||||||
{
|
{
|
||||||
|
@ -1611,8 +1603,6 @@ fun_getProperty(JSContext *cx, JSObject *obj, jsid id, Value *vp)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
struct LazyFunctionDataProp {
|
struct LazyFunctionDataProp {
|
||||||
uint16 atomOffset;
|
uint16 atomOffset;
|
||||||
int8 tinyid;
|
int8 tinyid;
|
||||||
|
@ -1626,19 +1616,17 @@ struct PoisonPillProp {
|
||||||
|
|
||||||
/* NB: no sentinels at ends -- use JS_ARRAY_LENGTH to bound loops. */
|
/* NB: no sentinels at ends -- use JS_ARRAY_LENGTH to bound loops. */
|
||||||
|
|
||||||
const LazyFunctionDataProp lazyFunctionDataProps[] = {
|
static const LazyFunctionDataProp lazyFunctionDataProps[] = {
|
||||||
{ATOM_OFFSET(arity), FUN_ARITY, JSPROP_PERMANENT|JSPROP_READONLY},
|
{ATOM_OFFSET(arity), FUN_ARITY, JSPROP_PERMANENT|JSPROP_READONLY},
|
||||||
{ATOM_OFFSET(name), FUN_NAME, JSPROP_PERMANENT|JSPROP_READONLY},
|
{ATOM_OFFSET(name), FUN_NAME, JSPROP_PERMANENT|JSPROP_READONLY},
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Properties censored into [[ThrowTypeError]] in strict mode. */
|
/* Properties censored into [[ThrowTypeError]] in strict mode. */
|
||||||
const PoisonPillProp poisonPillProps[] = {
|
static const PoisonPillProp poisonPillProps[] = {
|
||||||
{ATOM_OFFSET(arguments), FUN_ARGUMENTS },
|
{ATOM_OFFSET(arguments), FUN_ARGUMENTS },
|
||||||
{ATOM_OFFSET(caller), FUN_CALLER },
|
{ATOM_OFFSET(caller), FUN_CALLER },
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSBool
|
static JSBool
|
||||||
fun_enumerate(JSContext *cx, JSObject *obj)
|
fun_enumerate(JSContext *cx, JSObject *obj)
|
||||||
{
|
{
|
||||||
|
@ -2238,8 +2226,6 @@ js_fun_call(JSContext *cx, uintN argc, Value *vp)
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
struct STATIC_SKIP_INFERENCE CopyNonHoleArgs
|
struct STATIC_SKIP_INFERENCE CopyNonHoleArgs
|
||||||
{
|
{
|
||||||
CopyNonHoleArgs(JSObject *aobj, Value *dst) : aobj(aobj), dst(dst) {}
|
CopyNonHoleArgs(JSObject *aobj, Value *dst) : aobj(aobj), dst(dst) {}
|
||||||
|
@ -2254,8 +2240,6 @@ struct STATIC_SKIP_INFERENCE CopyNonHoleArgs
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ES5 15.3.4.3 */
|
/* ES5 15.3.4.3 */
|
||||||
JSBool
|
JSBool
|
||||||
js_fun_apply(JSContext *cx, uintN argc, Value *vp)
|
js_fun_apply(JSContext *cx, uintN argc, Value *vp)
|
||||||
|
@ -2360,11 +2344,8 @@ js_fun_apply(JSContext *cx, uintN argc, Value *vp)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
static JSBool
|
||||||
|
|
||||||
JSBool
|
|
||||||
CallOrConstructBoundFunction(JSContext *cx, uintN argc, Value *vp);
|
CallOrConstructBoundFunction(JSContext *cx, uintN argc, Value *vp);
|
||||||
}
|
|
||||||
|
|
||||||
inline bool
|
inline bool
|
||||||
JSObject::initBoundFunction(JSContext *cx, const Value &thisArg,
|
JSObject::initBoundFunction(JSContext *cx, const Value &thisArg,
|
||||||
|
@ -2424,10 +2405,8 @@ JSObject::getBoundFunctionArguments(uintN &argslen) const
|
||||||
return getSlots() + FUN_CLASS_RESERVED_SLOTS;
|
return getSlots() + FUN_CLASS_RESERVED_SLOTS;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
/* ES5 15.3.4.5.1 and 15.3.4.5.2. */
|
/* ES5 15.3.4.5.1 and 15.3.4.5.2. */
|
||||||
JSBool
|
static JSBool
|
||||||
CallOrConstructBoundFunction(JSContext *cx, uintN argc, Value *vp)
|
CallOrConstructBoundFunction(JSContext *cx, uintN argc, Value *vp)
|
||||||
{
|
{
|
||||||
JSObject *obj = &vp[0].toObject();
|
JSObject *obj = &vp[0].toObject();
|
||||||
|
@ -2475,7 +2454,7 @@ CallOrConstructBoundFunction(JSContext *cx, uintN argc, Value *vp)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ES5 15.3.4.5. */
|
/* ES5 15.3.4.5. */
|
||||||
JSBool
|
static JSBool
|
||||||
fun_bind(JSContext *cx, uintN argc, Value *vp)
|
fun_bind(JSContext *cx, uintN argc, Value *vp)
|
||||||
{
|
{
|
||||||
/* Step 1. */
|
/* Step 1. */
|
||||||
|
@ -2534,8 +2513,6 @@ fun_bind(JSContext *cx, uintN argc, Value *vp)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
static JSFunctionSpec function_methods[] = {
|
static JSFunctionSpec function_methods[] = {
|
||||||
#if JS_HAS_TOSOURCE
|
#if JS_HAS_TOSOURCE
|
||||||
JS_FN(js_toSource_str, fun_toSource, 0,0),
|
JS_FN(js_toSource_str, fun_toSource, 0,0),
|
||||||
|
@ -2766,9 +2743,7 @@ Function(JSContext *cx, uintN argc, Value *vp)
|
||||||
filename, lineno);
|
filename, lineno);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
static JSBool
|
||||||
|
|
||||||
JSBool
|
|
||||||
ThrowTypeError(JSContext *cx, uintN argc, Value *vp)
|
ThrowTypeError(JSContext *cx, uintN argc, Value *vp)
|
||||||
{
|
{
|
||||||
JS_ReportErrorFlagsAndNumber(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL,
|
JS_ReportErrorFlagsAndNumber(cx, JSREPORT_ERROR, js_GetErrorMessage, NULL,
|
||||||
|
@ -2776,8 +2751,6 @@ ThrowTypeError(JSContext *cx, uintN argc, Value *vp)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
JSObject *
|
JSObject *
|
||||||
js_InitFunctionClass(JSContext *cx, JSObject *obj)
|
js_InitFunctionClass(JSContext *cx, JSObject *obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -104,14 +104,12 @@ JS_STATIC_ASSERT(uintptr_t(PTRDIFF_MAX) + uintptr_t(1) == uintptr_t(PTRDIFF_MIN)
|
||||||
|
|
||||||
#endif /* JS_HAVE_STDINT_H */
|
#endif /* JS_HAVE_STDINT_H */
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we're accumulating a decimal number and the number is >= 2^53, then the
|
* If we're accumulating a decimal number and the number is >= 2^53, then the
|
||||||
* fast result from the loop in GetPrefixInteger may be inaccurate. Call
|
* fast result from the loop in GetPrefixInteger may be inaccurate. Call
|
||||||
* js_strtod_harder to get the correct answer.
|
* js_strtod_harder to get the correct answer.
|
||||||
*/
|
*/
|
||||||
bool
|
static bool
|
||||||
ComputeAccurateDecimalInteger(JSContext *cx, const jschar *start, const jschar *end, jsdouble *dp)
|
ComputeAccurateDecimalInteger(JSContext *cx, const jschar *start, const jschar *end, jsdouble *dp)
|
||||||
{
|
{
|
||||||
size_t length = end - start;
|
size_t length = end - start;
|
||||||
|
@ -186,7 +184,7 @@ class BinaryDigitReader
|
||||||
* down. An example occurs when reading the number 0x1000000000000081, which
|
* down. An example occurs when reading the number 0x1000000000000081, which
|
||||||
* rounds to 0x1000000000000000 instead of 0x1000000000000100.
|
* rounds to 0x1000000000000000 instead of 0x1000000000000100.
|
||||||
*/
|
*/
|
||||||
jsdouble
|
static jsdouble
|
||||||
ComputeAccurateBinaryBaseInteger(JSContext *cx, const jschar *start, const jschar *end, int base)
|
ComputeAccurateBinaryBaseInteger(JSContext *cx, const jschar *start, const jschar *end, int base)
|
||||||
{
|
{
|
||||||
BinaryDigitReader bdr(base, start, end);
|
BinaryDigitReader bdr(base, start, end);
|
||||||
|
@ -226,8 +224,6 @@ ComputeAccurateBinaryBaseInteger(JSContext *cx, const jschar *start, const jscha
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
namespace js {
|
namespace js {
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -346,9 +342,7 @@ ParseFloat(JSContext* cx, JSString* str)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
static bool
|
||||||
|
|
||||||
bool
|
|
||||||
ParseIntStringHelper(JSContext *cx, const jschar *ws, const jschar *end, int maybeRadix,
|
ParseIntStringHelper(JSContext *cx, const jschar *ws, const jschar *end, int maybeRadix,
|
||||||
bool stripPrefix, jsdouble *dp)
|
bool stripPrefix, jsdouble *dp)
|
||||||
{
|
{
|
||||||
|
@ -401,7 +395,7 @@ ParseIntStringHelper(JSContext *cx, const jschar *ws, const jschar *end, int may
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
jsdouble
|
static jsdouble
|
||||||
ParseIntDoubleHelper(jsdouble d)
|
ParseIntDoubleHelper(jsdouble d)
|
||||||
{
|
{
|
||||||
if (!JSDOUBLE_IS_FINITE(d))
|
if (!JSDOUBLE_IS_FINITE(d))
|
||||||
|
@ -413,8 +407,6 @@ ParseIntDoubleHelper(jsdouble d)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
/* See ECMA 15.1.2.2. */
|
/* See ECMA 15.1.2.2. */
|
||||||
static JSBool
|
static JSBool
|
||||||
num_parseInt(JSContext *cx, uintN argc, Value *vp)
|
num_parseInt(JSContext *cx, uintN argc, Value *vp)
|
||||||
|
|
|
@ -1229,8 +1229,6 @@ js_BoyerMooreHorspool(const jschar *text, jsuint textlen,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
struct MemCmp {
|
struct MemCmp {
|
||||||
typedef jsuint Extent;
|
typedef jsuint Extent;
|
||||||
static JS_ALWAYS_INLINE Extent computeExtent(const jschar *, jsuint patlen) {
|
static JS_ALWAYS_INLINE Extent computeExtent(const jschar *, jsuint patlen) {
|
||||||
|
@ -1255,8 +1253,6 @@ struct ManualCmp {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class InnerMatch>
|
template <class InnerMatch>
|
||||||
static jsint
|
static jsint
|
||||||
UnrolledMatch(const jschar *text, jsuint textlen, const jschar *pat, jsuint patlen)
|
UnrolledMatch(const jschar *text, jsuint textlen, const jschar *pat, jsuint patlen)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче