Split jsconfig.h JS_HAS_XDR macro for better code factoring.

This commit is contained in:
brendan%mozilla.org 2003-10-11 18:17:53 +00:00
Родитель 93972e89af
Коммит dec5855fd7
2 изменённых файлов: 22 добавлений и 15 удалений

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

@ -107,7 +107,8 @@
#define JS_HAS_SHARP_VARS 0 /* has #n=, #n# for object literals */
#define JS_HAS_REPLACE_LAMBDA 1 /* has string.replace(re, lambda) */
#define JS_HAS_SCRIPT_OBJECT 0 /* has (new Script("x++")).exec() */
#define JS_HAS_XDR 0 /* has XDR API and object methods */
#define JS_HAS_XDR 0 /* has XDR API and internal support */
#define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
#define JS_HAS_EXCEPTIONS 1 /* has exception handling */
#define JS_HAS_UNDEFINED 1 /* has global "undefined" property */
#define JS_HAS_TOSOURCE 0 /* has Object/Array toSource method */
@ -163,7 +164,8 @@
#define JS_HAS_SHARP_VARS 0 /* has #n=, #n# for object literals */
#define JS_HAS_REPLACE_LAMBDA 0 /* has string.replace(re, lambda) */
#define JS_HAS_SCRIPT_OBJECT 0 /* has (new Script("x++")).exec() */
#define JS_HAS_XDR 0 /* has XDR API and object methods */
#define JS_HAS_XDR 0 /* has XDR API and internal support */
#define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
#define JS_HAS_EXCEPTIONS 0 /* has exception handling */
#define JS_HAS_UNDEFINED 0 /* has global "undefined" property */
#define JS_HAS_TOSOURCE 0 /* has Object/Array toSource method */
@ -219,7 +221,8 @@
#define JS_HAS_SHARP_VARS 0 /* has #n=, #n# for object literals */
#define JS_HAS_REPLACE_LAMBDA 0 /* has string.replace(re, lambda) */
#define JS_HAS_SCRIPT_OBJECT 0 /* has (new Script("x++")).exec() */
#define JS_HAS_XDR 0 /* has XDR API and object methods */
#define JS_HAS_XDR 0 /* has XDR API and internal support */
#define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
#define JS_HAS_EXCEPTIONS 0 /* has exception handling */
#define JS_HAS_UNDEFINED 0 /* has global "undefined" property */
#define JS_HAS_TOSOURCE 0 /* has Object/Array toSource method */
@ -275,7 +278,8 @@
#define JS_HAS_SHARP_VARS 0 /* has #n=, #n# for object literals */
#define JS_HAS_REPLACE_LAMBDA 0 /* has string.replace(re, lambda) */
#define JS_HAS_SCRIPT_OBJECT 0 /* has (new Script("x++")).exec() */
#define JS_HAS_XDR 0 /* has XDR API and object methods */
#define JS_HAS_XDR 0 /* has XDR API and internal support */
#define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
#define JS_HAS_EXCEPTIONS 0 /* has exception handling */
#define JS_HAS_UNDEFINED 0 /* has global "undefined" property */
#define JS_HAS_TOSOURCE 0 /* has Object/Array toSource method */
@ -331,7 +335,8 @@
#define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */
#define JS_HAS_REPLACE_LAMBDA 1 /* has string.replace(re, lambda) */
#define JS_HAS_SCRIPT_OBJECT 1 /* has (new Script("x++")).exec() */
#define JS_HAS_XDR 1 /* has XDR API and object methods */
#define JS_HAS_XDR 0 /* has XDR API and internal support */
#define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
#define JS_HAS_EXCEPTIONS 0 /* has exception handling */
#define JS_HAS_UNDEFINED 1 /* has global "undefined" property */
#define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */
@ -387,8 +392,9 @@
#define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */
#define JS_HAS_REPLACE_LAMBDA 1 /* has string.replace(re, lambda) */
#define JS_HAS_SCRIPT_OBJECT 1 /* has (new Script("x++")).exec() */
#define JS_HAS_XDR 1 /* has XDR API and object methods */
#define JS_HAS_EXCEPTIONS 1 /* has exception handling */
#define JS_HAS_XDR 0 /* has XDR API and internal support */
#define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
#define JS_HAS_EXCEPTIONS 1 /* has exception handling */
#define JS_HAS_UNDEFINED 1 /* has global "undefined" property */
#define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */
#define JS_HAS_IN_OPERATOR 1 /* has in operator ('p' in {p:1}) */
@ -443,7 +449,8 @@
#define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */
#define JS_HAS_REPLACE_LAMBDA 1 /* has string.replace(re, lambda) */
#define JS_HAS_SCRIPT_OBJECT 1 /* has (new Script("x++")).exec() */
#define JS_HAS_XDR 1 /* has XDR API and object methods */
#define JS_HAS_XDR 0 /* has XDR API and internal support */
#define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
#define JS_HAS_EXCEPTIONS 1 /* has exception handling */
#define JS_HAS_UNDEFINED 1 /* has global "undefined" property */
#define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */

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

@ -563,7 +563,7 @@ js_XDRScript(JSXDRState *xdr, JSScript **scriptp, JSBool *hasMagic)
return JS_FALSE;
}
#ifndef MOZILLA_CLIENT
#if JS_HAS_XDR_FREEZE_THAW
/*
* These cannot be exposed to web content, and chrome does not need them, so
* we take them out of the Mozilla client altogether. Fortunately, there is
@ -718,7 +718,7 @@ out:
static const char js_thaw_str[] = "thaw";
#endif /* !defined MOZILLA_CLIENT */
#endif /* JS_HAS_XDR_FREEZE_THAW */
#endif /* JS_HAS_XDR */
static JSFunctionSpec script_methods[] = {
@ -728,10 +728,10 @@ static JSFunctionSpec script_methods[] = {
{js_toString_str, script_toString, 0,0,0},
{"compile", script_compile, 2,0,0},
{"exec", script_exec, 1,0,0},
#if JS_HAS_XDR && !defined MOZILLA_CLIENT
#if JS_HAS_XDR_FREEZE_THAW
{"freeze", script_freeze, 0,0,0},
{js_thaw_str, script_thaw, 1,0,0},
#endif /* JS_HAS_XDR && !defined MOZILLA_CLIENT */
#endif /* JS_HAS_XDR_FREEZE_THAW */
{0,0,0,0,0}
};
@ -791,7 +791,7 @@ Script(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
return script_compile(cx, obj, argc, argv, rval);
}
#if JS_HAS_XDR && !defined MOZILLA_CLIENT
#if JS_HAS_XDR_FREEZE_THAW
static JSBool
script_static_thaw(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
@ -811,11 +811,11 @@ static JSFunctionSpec script_static_methods[] = {
{0,0,0,0,0}
};
#else /* !JS_HAS_XDR || defined MOZILLA_CLIENT */
#else /* !JS_HAS_XDR_FREEZE_THAW */
#define script_static_methods NULL
#endif /* !JS_HAS_XDR || defined MOZILLA_CLIENT */
#endif /* !JS_HAS_XDR_FREEZE_THAW */
JSObject *
js_InitScriptClass(JSContext *cx, JSObject *obj)