PageRenderTime 137ms CodeModel.GetById 1ms RepoModel.GetById 0ms app.codeStats 0ms

/js/lib/Socket.IO-node/support/expresso/deps/jscoverage/js/jsversion.h

http://github.com/onedayitwillmake/RealtimeMultiplayerNodeJs
C++ Header | 243 lines | 153 code | 19 blank | 71 comment | 9 complexity | 61dd1ec93a35922a5d5a917c034700d6 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, BSD-3-Clause
  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. *
  3. * ***** BEGIN LICENSE BLOCK *****
  4. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. *
  6. * The contents of this file are subject to the Mozilla Public License Version
  7. * 1.1 (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. * http://www.mozilla.org/MPL/
  10. *
  11. * Software distributed under the License is distributed on an "AS IS" basis,
  12. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. * for the specific language governing rights and limitations under the
  14. * License.
  15. *
  16. * The Original Code is Mozilla Communicator client code, released
  17. * March 31, 1998.
  18. *
  19. * The Initial Developer of the Original Code is
  20. * Netscape Communications Corporation.
  21. * Portions created by the Initial Developer are Copyright (C) 1998
  22. * the Initial Developer. All Rights Reserved.
  23. *
  24. * Contributor(s):
  25. *
  26. * Alternatively, the contents of this file may be used under the terms of
  27. * either of the GNU General Public License Version 2 or later (the "GPL"),
  28. * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  29. * in which case the provisions of the GPL or the LGPL are applicable instead
  30. * of those above. If you wish to allow use of your version of this file only
  31. * under the terms of either the GPL or the LGPL, and not to allow others to
  32. * use your version of this file under the terms of the MPL, indicate your
  33. * decision by deleting the provisions above and replace them with the notice
  34. * and other provisions required by the GPL or the LGPL. If you do not delete
  35. * the provisions above, a recipient may use your version of this file under
  36. * the terms of any one of the MPL, the GPL or the LGPL.
  37. *
  38. * ***** END LICENSE BLOCK ***** */
  39. /*
  40. * JS configuration macros.
  41. */
  42. #ifndef JS_VERSION
  43. #define JS_VERSION 180
  44. #endif
  45. /*
  46. * Compile-time JS version configuration. The JS version numbers lie on the
  47. * number line like so:
  48. *
  49. * 1.0 1.1 1.2 1.3 1.4 ECMAv3 1.5 1.6 1.7 1.8
  50. * ^ ^
  51. * | |
  52. * basis for ECMAv1 close to ECMAv2
  53. *
  54. * where ECMAv3 stands for ECMA-262 Edition 3. See the runtime version enum
  55. * JSVersion in jspubtd.h. Code in the engine can therefore count on version
  56. * <= JSVERSION_1_4 to mean "before the Third Edition of ECMA-262" and version
  57. * > JSVERSION_1_4 to mean "at or after the Third Edition".
  58. *
  59. * In the (likely?) event that SpiderMonkey grows to implement JavaScript 2.0,
  60. * or ECMA-262 Edition 4 (JS2 without certain extensions), the version number
  61. * to use would be near 200, or greater.
  62. *
  63. * The JS_VERSION_ECMA_3 version is the minimal configuration conforming to
  64. * the ECMA-262 Edition 3 specification. Use it for minimal embeddings, where
  65. * you're sure you don't need any of the extensions disabled in this version.
  66. * In order to facilitate testing, JS_HAS_OBJ_PROTO_PROP is defined as part of
  67. * the JS_VERSION_ECMA_3_TEST version.
  68. *
  69. * To keep things sane in the modern age, where we need exceptions in order to
  70. * implement, e.g., iterators and generators, we are dropping support for all
  71. * versions <= 1.4.
  72. */
  73. #define JS_VERSION_ECMA_3 148
  74. #define JS_VERSION_ECMA_3_TEST 149
  75. #if JS_VERSION == JS_VERSION_ECMA_3 || \
  76. JS_VERSION == JS_VERSION_ECMA_3_TEST
  77. #define JS_HAS_STR_HTML_HELPERS 0 /* has str.anchor, str.bold, etc. */
  78. #define JS_HAS_PERL_SUBSTR 0 /* has str.substr */
  79. #if JS_VERSION == JS_VERSION_ECMA_3_TEST
  80. #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */
  81. #else
  82. #define JS_HAS_OBJ_PROTO_PROP 0 /* has o.__proto__ etc. */
  83. #endif
  84. #define JS_HAS_OBJ_WATCHPOINT 0 /* has o.watch and o.unwatch */
  85. #define JS_HAS_EVAL_THIS_SCOPE 0 /* Math.eval is same as with (Math) */
  86. #define JS_HAS_SHARP_VARS 0 /* has #n=, #n# for object literals */
  87. #define JS_HAS_SCRIPT_OBJECT 0 /* has (new Script("x++")).exec() */
  88. #define JS_HAS_XDR 0 /* has XDR API and internal support */
  89. #define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
  90. #define JS_HAS_TOSOURCE 0 /* has Object/Array toSource method */
  91. #define JS_HAS_DEBUGGER_KEYWORD 0 /* has hook for debugger keyword */
  92. #define JS_HAS_CATCH_GUARD 0 /* has exception handling catch guard */
  93. #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */
  94. #define JS_HAS_GETTER_SETTER 0 /* has JS2 getter/setter functions */
  95. #define JS_HAS_UNEVAL 0 /* has uneval() top-level function */
  96. #define JS_HAS_CONST 0 /* has JS2 const as alternative var */
  97. #define JS_HAS_FUN_EXPR_STMT 0 /* has function expression statement */
  98. #define JS_HAS_LVALUE_RETURN 1 /* has o.item(i) = j; for native item */
  99. #define JS_HAS_NO_SUCH_METHOD 0 /* has o.__noSuchMethod__ handler */
  100. #define JS_HAS_XML_SUPPORT 0 /* has ECMAScript for XML support */
  101. #define JS_HAS_ARRAY_EXTRAS 0 /* has indexOf and Lispy extras */
  102. #define JS_HAS_GENERATORS 0 /* has yield in generator function */
  103. #define JS_HAS_BLOCK_SCOPE 0 /* has block scope via let/arraycomp */
  104. #define JS_HAS_DESTRUCTURING 0 /* has [a,b] = ... or {p:a,q:b} = ... */
  105. #define JS_HAS_GENERATOR_EXPRS 0 /* has (expr for (lhs in iterable)) */
  106. #define JS_HAS_EXPR_CLOSURES 0 /* has function (formals) listexpr */
  107. #elif JS_VERSION < 150
  108. #error "unsupported JS_VERSION"
  109. #elif JS_VERSION == 150
  110. #define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */
  111. #define JS_HAS_PERL_SUBSTR 1 /* has str.substr */
  112. #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */
  113. #define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */
  114. #define JS_HAS_EVAL_THIS_SCOPE 1 /* Math.eval is same as with (Math) */
  115. #define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */
  116. #define JS_HAS_SCRIPT_OBJECT 1 /* has (new Script("x++")).exec() */
  117. #define JS_HAS_XDR 1 /* has XDR API and internal support */
  118. #define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
  119. #define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */
  120. #define JS_HAS_DEBUGGER_KEYWORD 1 /* has hook for debugger keyword */
  121. #define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */
  122. #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */
  123. #define JS_HAS_GETTER_SETTER 1 /* has JS2 getter/setter functions */
  124. #define JS_HAS_UNEVAL 1 /* has uneval() top-level function */
  125. #define JS_HAS_CONST 1 /* has JS2 const as alternative var */
  126. #define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */
  127. #define JS_HAS_LVALUE_RETURN 1 /* has o.item(i) = j; for native item */
  128. #define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */
  129. #define JS_HAS_XML_SUPPORT 0 /* has ECMAScript for XML support */
  130. #define JS_HAS_ARRAY_EXTRAS 0 /* has indexOf and Lispy extras */
  131. #define JS_HAS_GENERATORS 0 /* has yield in generator function */
  132. #define JS_HAS_BLOCK_SCOPE 0 /* has block scope via let/arraycomp */
  133. #define JS_HAS_DESTRUCTURING 0 /* has [a,b] = ... or {p:a,q:b} = ... */
  134. #define JS_HAS_GENERATOR_EXPRS 0 /* has (expr for (lhs in iterable)) */
  135. #define JS_HAS_EXPR_CLOSURES 0 /* has function (formals) listexpr */
  136. #elif JS_VERSION == 160
  137. #define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */
  138. #define JS_HAS_PERL_SUBSTR 1 /* has str.substr */
  139. #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */
  140. #define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */
  141. #define JS_HAS_EVAL_THIS_SCOPE 1 /* Math.eval is same as with (Math) */
  142. #define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */
  143. #define JS_HAS_SCRIPT_OBJECT 1 /* has (new Script("x++")).exec() */
  144. #define JS_HAS_XDR 1 /* has XDR API and internal support */
  145. #define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
  146. #define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */
  147. #define JS_HAS_DEBUGGER_KEYWORD 1 /* has hook for debugger keyword */
  148. #define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */
  149. #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */
  150. #define JS_HAS_GETTER_SETTER 1 /* has JS2 getter/setter functions */
  151. #define JS_HAS_UNEVAL 1 /* has uneval() top-level function */
  152. #define JS_HAS_CONST 1 /* has JS2 const as alternative var */
  153. #define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */
  154. #define JS_HAS_LVALUE_RETURN 1 /* has o.item(i) = j; for native item */
  155. #define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */
  156. #define JS_HAS_XML_SUPPORT 1 /* has ECMAScript for XML support */
  157. #define JS_HAS_ARRAY_EXTRAS 1 /* has indexOf and Lispy extras */
  158. #define JS_HAS_GENERATORS 0 /* has yield in generator function */
  159. #define JS_HAS_BLOCK_SCOPE 0 /* has block scope via let/arraycomp */
  160. #define JS_HAS_DESTRUCTURING 0 /* has [a,b] = ... or {p:a,q:b} = ... */
  161. #define JS_HAS_GENERATOR_EXPRS 0 /* has (expr for (lhs in iterable)) */
  162. #define JS_HAS_EXPR_CLOSURES 0 /* has function (formals) listexpr */
  163. #elif JS_VERSION == 170
  164. #define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */
  165. #define JS_HAS_PERL_SUBSTR 1 /* has str.substr */
  166. #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */
  167. #define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */
  168. #define JS_HAS_EVAL_THIS_SCOPE 1 /* Math.eval is same as with (Math) */
  169. #define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */
  170. #define JS_HAS_SCRIPT_OBJECT 0 /* has (new Script("x++")).exec() */
  171. #define JS_HAS_XDR 1 /* has XDR API and internal support */
  172. #define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
  173. #define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */
  174. #define JS_HAS_DEBUGGER_KEYWORD 1 /* has hook for debugger keyword */
  175. #define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */
  176. #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */
  177. #define JS_HAS_GETTER_SETTER 1 /* has JS2 getter/setter functions */
  178. #define JS_HAS_UNEVAL 1 /* has uneval() top-level function */
  179. #define JS_HAS_CONST 1 /* has JS2 const as alternative var */
  180. #define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */
  181. #define JS_HAS_LVALUE_RETURN 1 /* has o.item(i) = j; for native item */
  182. #define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */
  183. #define JS_HAS_XML_SUPPORT 1 /* has ECMAScript for XML support */
  184. #define JS_HAS_ARRAY_EXTRAS 1 /* has indexOf and Lispy extras */
  185. #define JS_HAS_GENERATORS 1 /* has yield in generator function */
  186. #define JS_HAS_BLOCK_SCOPE 1 /* has block scope via let/arraycomp */
  187. #define JS_HAS_DESTRUCTURING 1 /* has [a,b] = ... or {p:a,q:b} = ... */
  188. #define JS_HAS_GENERATOR_EXPRS 0 /* has (expr for (lhs in iterable)) */
  189. #define JS_HAS_EXPR_CLOSURES 0 /* has function (formals) listexpr */
  190. #elif JS_VERSION == 180
  191. #define JS_HAS_STR_HTML_HELPERS 1 /* has str.anchor, str.bold, etc. */
  192. #define JS_HAS_PERL_SUBSTR 1 /* has str.substr */
  193. #define JS_HAS_OBJ_PROTO_PROP 1 /* has o.__proto__ etc. */
  194. #define JS_HAS_OBJ_WATCHPOINT 1 /* has o.watch and o.unwatch */
  195. #define JS_HAS_EVAL_THIS_SCOPE 1 /* Math.eval is same as with (Math) */
  196. #define JS_HAS_SHARP_VARS 1 /* has #n=, #n# for object literals */
  197. #define JS_HAS_SCRIPT_OBJECT 0 /* has (new Script("x++")).exec() */
  198. #define JS_HAS_XDR 1 /* has XDR API and internal support */
  199. #define JS_HAS_XDR_FREEZE_THAW 0 /* has XDR freeze/thaw script methods */
  200. #define JS_HAS_TOSOURCE 1 /* has Object/Array toSource method */
  201. #define JS_HAS_DEBUGGER_KEYWORD 1 /* has hook for debugger keyword */
  202. #define JS_HAS_CATCH_GUARD 1 /* has exception handling catch guard */
  203. #define JS_HAS_SPARSE_ARRAYS 0 /* array methods preserve empty elems */
  204. #define JS_HAS_GETTER_SETTER 1 /* has JS2 getter/setter functions */
  205. #define JS_HAS_UNEVAL 1 /* has uneval() top-level function */
  206. #define JS_HAS_CONST 1 /* has JS2 const as alternative var */
  207. #define JS_HAS_FUN_EXPR_STMT 1 /* has function expression statement */
  208. #define JS_HAS_LVALUE_RETURN 1 /* has o.item(i) = j; for native item */
  209. #define JS_HAS_NO_SUCH_METHOD 1 /* has o.__noSuchMethod__ handler */
  210. #define JS_HAS_XML_SUPPORT 1 /* has ECMAScript for XML support */
  211. #define JS_HAS_ARRAY_EXTRAS 1 /* has indexOf and Lispy extras */
  212. #define JS_HAS_GENERATORS 1 /* has yield in generator function */
  213. #define JS_HAS_BLOCK_SCOPE 1 /* has block scope via let/arraycomp */
  214. #define JS_HAS_DESTRUCTURING 2 /* has [a,b] = ... or {p:a,q:b} = ... */
  215. #define JS_HAS_GENERATOR_EXPRS 1 /* has (expr for (lhs in iterable)) */
  216. #define JS_HAS_EXPR_CLOSURES 1 /* has function (formals) listexpr */
  217. #else
  218. #error "unknown JS_VERSION"
  219. #endif
  220. /* Features that are present in all versions. */
  221. #define JS_HAS_RESERVED_JAVA_KEYWORDS 1
  222. #define JS_HAS_RESERVED_ECMA_KEYWORDS 1
  223. /* Feature-test macro for evolving destructuring support. */
  224. #define JS_HAS_DESTRUCTURING_SHORTHAND (JS_HAS_DESTRUCTURING == 2)