Back to index

lightning-sunbird  0.9+nobinonly
jsconfig.h
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is Mozilla Communicator client code, released
00017  * March 31, 1998.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 1998
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *
00026  * Alternatively, the contents of this file may be used under the terms of
00027  * either of the GNU General Public License Version 2 or later (the "GPL"),
00028  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00029  * in which case the provisions of the GPL or the LGPL are applicable instead
00030  * of those above. If you wish to allow use of your version of this file only
00031  * under the terms of either the GPL or the LGPL, and not to allow others to
00032  * use your version of this file under the terms of the MPL, indicate your
00033  * decision by deleting the provisions above and replace them with the notice
00034  * and other provisions required by the GPL or the LGPL. If you do not delete
00035  * the provisions above, a recipient may use your version of this file under
00036  * the terms of any one of the MPL, the GPL or the LGPL.
00037  *
00038  * ***** END LICENSE BLOCK ***** */
00039 
00040 /*
00041  * JS configuration macros.
00042  */
00043 #ifndef JS_VERSION
00044 #define JS_VERSION 170
00045 #endif
00046 
00047 /*
00048  * Compile-time JS version configuration.  The JS version numbers lie on the
00049  * number line like so:
00050  *
00051  *      1.0     1.1     1.2     1.3     1.4     ECMAv3  1.5     1.6
00052  *              ^                       ^
00053  *              |                       |
00054  *              basis for ECMAv1        close to ECMAv2
00055  *
00056  * where ECMAv3 stands for ECMA-262 Edition 3.  See the runtime version enum
00057  * JSVersion in jspubtd.h.  Code in the engine can therefore count on version
00058  * <= JSVERSION_1_4 to mean "before the Third Edition of ECMA-262" and version
00059  * > JSVERSION_1_4 to mean "at or after the Third Edition".
00060  *
00061  * In the (likely?) event that SpiderMonkey grows to implement JavaScript 2.0,
00062  * or ECMA-262 Edition 4 (JS2 without certain extensions), the version number
00063  * to use would be near 200, or greater.
00064  *
00065  * The JS_VERSION_ECMA_3 version is the minimal configuration conforming to
00066  * the ECMA-262 Edition 3 specification.  Use it for minimal embeddings, where
00067  * you're sure you don't need any of the extensions disabled in this version.
00068  * In order to facilitate testing, JS_HAS_OBJ_PROTO_PROP is defined as part of
00069  * the JS_VERSION_ECMA_3_TEST version.
00070  *
00071  * To keep things sane in the modern age, where we need exceptions in order to
00072  * implement, e.g., iterators and generators, we are dropping support for all
00073  * versions <= 1.4.
00074  */
00075 #define JS_VERSION_ECMA_3       148
00076 #define JS_VERSION_ECMA_3_TEST  149
00077 
00078 #if JS_VERSION == JS_VERSION_ECMA_3 ||                                        \
00079     JS_VERSION == JS_VERSION_ECMA_3_TEST
00080 
00081 #define JS_HAS_STR_HTML_HELPERS 0       /* has str.anchor, str.bold, etc. */
00082 #define JS_HAS_PERL_SUBSTR      0       /* has str.substr */
00083 #if JS_VERSION == JS_VERSION_ECMA_3_TEST
00084 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
00085 #else
00086 #define JS_HAS_OBJ_PROTO_PROP   0       /* has o.__proto__ etc. */
00087 #endif
00088 #define JS_HAS_OBJ_WATCHPOINT   0       /* has o.watch and o.unwatch */
00089 #define JS_HAS_EXPORT_IMPORT    0       /* has export fun; import obj.fun */
00090 #define JS_HAS_EVAL_THIS_SCOPE  0       /* Math.eval is same as with (Math) */
00091 #define JS_HAS_SHARP_VARS       0       /* has #n=, #n# for object literals */
00092 #define JS_HAS_SCRIPT_OBJECT    0       /* has (new Script("x++")).exec() */
00093 #define JS_HAS_XDR              0       /* has XDR API and internal support */
00094 #define JS_HAS_XDR_FREEZE_THAW  0       /* has XDR freeze/thaw script methods */
00095 #define JS_HAS_TOSOURCE         0       /* has Object/Array toSource method */
00096 #define JS_HAS_DEBUGGER_KEYWORD 0       /* has hook for debugger keyword */
00097 #define JS_HAS_CATCH_GUARD      0       /* has exception handling catch guard */
00098 #define JS_HAS_SPARSE_ARRAYS    0       /* array methods preserve empty elems */
00099 #define JS_HAS_GETTER_SETTER    0       /* has JS2 getter/setter functions */
00100 #define JS_HAS_UNEVAL           0       /* has uneval() top-level function */
00101 #define JS_HAS_CONST            0       /* has JS2 const as alternative var */
00102 #define JS_HAS_FUN_EXPR_STMT    0       /* has function expression statement */
00103 #define JS_HAS_LVALUE_RETURN    1       /* has o.item(i) = j; for native item */
00104 #define JS_HAS_NO_SUCH_METHOD   0       /* has o.__noSuchMethod__ handler */
00105 #define JS_HAS_XML_SUPPORT      0       /* has ECMAScript for XML support */
00106 #define JS_HAS_ARRAY_EXTRAS     0       /* has indexOf and Lispy extras */
00107 #define JS_HAS_GENERATORS       0       /* has yield in generator function */
00108 #define JS_HAS_BLOCK_SCOPE      0       /* has block scope via let/arraycomp */
00109 #define JS_HAS_DESTRUCTURING    0       /* has [a,b] = ... or {p:a,q:b} = ... */
00110 
00111 #elif JS_VERSION < 150
00112 
00113 #error "unsupported JS_VERSION"
00114 
00115 #elif JS_VERSION == 150
00116 
00117 #define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */
00118 #define JS_HAS_PERL_SUBSTR      1       /* has str.substr */
00119 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
00120 #define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */
00121 #define JS_HAS_EXPORT_IMPORT    1       /* has export fun; import obj.fun */
00122 #define JS_HAS_EVAL_THIS_SCOPE  1       /* Math.eval is same as with (Math) */
00123 #define JS_HAS_SHARP_VARS       1       /* has #n=, #n# for object literals */
00124 #define JS_HAS_SCRIPT_OBJECT    1       /* has (new Script("x++")).exec() */
00125 #define JS_HAS_XDR              1       /* has XDR API and internal support */
00126 #define JS_HAS_XDR_FREEZE_THAW  0       /* has XDR freeze/thaw script methods */
00127 #define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */
00128 #define JS_HAS_DEBUGGER_KEYWORD 1       /* has hook for debugger keyword */
00129 #define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */
00130 #define JS_HAS_SPARSE_ARRAYS    0       /* array methods preserve empty elems */
00131 #define JS_HAS_GETTER_SETTER    1       /* has JS2 getter/setter functions */
00132 #define JS_HAS_UNEVAL           1       /* has uneval() top-level function */
00133 #define JS_HAS_CONST            1       /* has JS2 const as alternative var */
00134 #define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */
00135 #define JS_HAS_LVALUE_RETURN    1       /* has o.item(i) = j; for native item */
00136 #define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */
00137 #define JS_HAS_XML_SUPPORT      0       /* has ECMAScript for XML support */
00138 #define JS_HAS_ARRAY_EXTRAS     0       /* has indexOf and Lispy extras */
00139 #define JS_HAS_GENERATORS       0       /* has yield in generator function */
00140 #define JS_HAS_BLOCK_SCOPE      0       /* has block scope via let/arraycomp */
00141 #define JS_HAS_DESTRUCTURING    0       /* has [a,b] = ... or {p:a,q:b} = ... */
00142 
00143 #elif JS_VERSION == 160
00144 
00145 #define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */
00146 #define JS_HAS_PERL_SUBSTR      1       /* has str.substr */
00147 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
00148 #define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */
00149 #define JS_HAS_EXPORT_IMPORT    1       /* has export fun; import obj.fun */
00150 #define JS_HAS_EVAL_THIS_SCOPE  1       /* Math.eval is same as with (Math) */
00151 #define JS_HAS_SHARP_VARS       1       /* has #n=, #n# for object literals */
00152 #define JS_HAS_SCRIPT_OBJECT    1       /* has (new Script("x++")).exec() */
00153 #define JS_HAS_XDR              1       /* has XDR API and internal support */
00154 #define JS_HAS_XDR_FREEZE_THAW  0       /* has XDR freeze/thaw script methods */
00155 #define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */
00156 #define JS_HAS_DEBUGGER_KEYWORD 1       /* has hook for debugger keyword */
00157 #define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */
00158 #define JS_HAS_SPARSE_ARRAYS    0       /* array methods preserve empty elems */
00159 #define JS_HAS_GETTER_SETTER    1       /* has JS2 getter/setter functions */
00160 #define JS_HAS_UNEVAL           1       /* has uneval() top-level function */
00161 #define JS_HAS_CONST            1       /* has JS2 const as alternative var */
00162 #define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */
00163 #define JS_HAS_LVALUE_RETURN    1       /* has o.item(i) = j; for native item */
00164 #define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */
00165 #define JS_HAS_XML_SUPPORT      1       /* has ECMAScript for XML support */
00166 #define JS_HAS_ARRAY_EXTRAS     1       /* has indexOf and Lispy extras */
00167 #define JS_HAS_GENERATORS       0       /* has yield in generator function */
00168 #define JS_HAS_BLOCK_SCOPE      0       /* has block scope via let/arraycomp */
00169 #define JS_HAS_DESTRUCTURING    0       /* has [a,b] = ... or {p:a,q:b} = ... */
00170 
00171 #elif JS_VERSION == 170
00172 
00173 #define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */
00174 #define JS_HAS_PERL_SUBSTR      1       /* has str.substr */
00175 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
00176 #define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */
00177 #define JS_HAS_EXPORT_IMPORT    1       /* has export fun; import obj.fun */
00178 #define JS_HAS_EVAL_THIS_SCOPE  1       /* Math.eval is same as with (Math) */
00179 #define JS_HAS_SHARP_VARS       1       /* has #n=, #n# for object literals */
00180 #define JS_HAS_SCRIPT_OBJECT    1       /* has (new Script("x++")).exec() */
00181 #define JS_HAS_XDR              1       /* has XDR API and internal support */
00182 #define JS_HAS_XDR_FREEZE_THAW  0       /* has XDR freeze/thaw script methods */
00183 #define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */
00184 #define JS_HAS_DEBUGGER_KEYWORD 1       /* has hook for debugger keyword */
00185 #define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */
00186 #define JS_HAS_SPARSE_ARRAYS    0       /* array methods preserve empty elems */
00187 #define JS_HAS_GETTER_SETTER    1       /* has JS2 getter/setter functions */
00188 #define JS_HAS_UNEVAL           1       /* has uneval() top-level function */
00189 #define JS_HAS_CONST            1       /* has JS2 const as alternative var */
00190 #define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */
00191 #define JS_HAS_LVALUE_RETURN    1       /* has o.item(i) = j; for native item */
00192 #define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */
00193 #define JS_HAS_XML_SUPPORT      1       /* has ECMAScript for XML support */
00194 #define JS_HAS_ARRAY_EXTRAS     1       /* has indexOf and Lispy extras */
00195 #define JS_HAS_GENERATORS       1       /* has yield in generator function */
00196 #define JS_HAS_BLOCK_SCOPE      1       /* has block scope via let/arraycomp */
00197 #define JS_HAS_DESTRUCTURING    1       /* has [a,b] = ... or {p:a,q:b} = ... */
00198 
00199 #else
00200 
00201 #error "unknown JS_VERSION"
00202 
00203 #endif
00204 
00205 /* Features that are present in all versions. */
00206 #define JS_HAS_RESERVED_JAVA_KEYWORDS   1
00207 #define JS_HAS_RESERVED_ECMA_KEYWORDS   1
00208