Bug 523139: Add an ECMAScript 5 value to the JSVersion type. r=brendan

This commit is contained in:
Jim Blandy 2009-10-27 14:17:01 -07:00
Родитель 7b336388ef
Коммит 2abe234f52
3 изменённых файлов: 12 добавлений и 10 удалений

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

@ -1143,6 +1143,7 @@ static struct v2smap {
{JSVERSION_1_6, "1.6"},
{JSVERSION_1_7, "1.7"},
{JSVERSION_1_8, "1.8"},
{JSVERSION_ECMA_5, "ECMAv5"},
{JSVERSION_DEFAULT, js_default_str},
{JSVERSION_UNKNOWN, NULL}, /* must be last, NULL is sentinel */
};

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

@ -72,9 +72,10 @@ typedef enum JSVersion {
JSVERSION_1_6 = 160,
JSVERSION_1_7 = 170,
JSVERSION_1_8 = 180,
JSVERSION_ECMA_5 = 185,
JSVERSION_DEFAULT = 0,
JSVERSION_UNKNOWN = -1,
JSVERSION_LATEST = JSVERSION_1_8
JSVERSION_LATEST = JSVERSION_ECMA_5
} JSVersion;
#define JSVERSION_IS_ECMA(version) \

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

@ -41,26 +41,26 @@
* JS configuration macros.
*/
#ifndef JS_VERSION
#define JS_VERSION 180
#define JS_VERSION 185
#endif
/*
* Compile-time JS version configuration. The JS version numbers lie on the
* number line like so:
*
* 1.0 1.1 1.2 1.3 1.4 ECMAv3 1.5 1.6 1.7 1.8
* 1.0 1.1 1.2 1.3 1.4 ECMAv3 1.5 1.6 1.7 1.8 ECMAv5
* ^ ^
* | |
* basis for ECMAv1 close to ECMAv2
*
* where ECMAv3 stands for ECMA-262 Edition 3. See the runtime version enum
* JSVersion in jspubtd.h. Code in the engine can therefore count on version
* <= JSVERSION_1_4 to mean "before the Third Edition of ECMA-262" and version
* > JSVERSION_1_4 to mean "at or after the Third Edition".
* where ECMAv3 stands for ECMA-262 Edition 3, and ECMAv5 stands for Edition 5.
* See the runtime version enum JSVersion in jspubtd.h. Code in the engine can
* therefore count on version <= JSVERSION_1_4 to mean "before the Third
* Edition of ECMA-262" and version > JSVERSION_1_4 to mean "at or after the
* Third Edition".
*
* In the (likely?) event that SpiderMonkey grows to implement JavaScript 2.0,
* or ECMA-262 Edition 4 (JS2 without certain extensions), the version number
* to use would be near 200, or greater.
* the version number to use would be near 200, or greater.
*
* The JS_VERSION_ECMA_3 version is the minimal configuration conforming to
* the ECMA-262 Edition 3 specification. Use it for minimal embeddings, where
@ -196,7 +196,7 @@
#define JS_HAS_GENERATOR_EXPRS 0 /* has (expr for (lhs in iterable)) */
#define JS_HAS_EXPR_CLOSURES 0 /* has function (formals) listexpr */
#elif JS_VERSION == 180
#elif 180 <= JS_VERSION && JS_VERSION <= 185
#define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */
#define JS_HAS_PERL_SUBSTR 1 /* has str.substr */