AcornSearch - Acorn and RISC OS information searching
RISC OS Search
containing
"Nutty quip goes here!"
Home  |  About  |  Filebase Archive  |  StrongHelp Manuals  |  Newsgroups  |  Module Database
Entry:     JS_GetVersion (Function)
Summary:     Retrieves the JavaScript version number used within a specified executable script context.
Syntax:
JSVersion JS_GetVersion(JSContext *cx);

Description:
JS_GetVersion reports an encapsulated JavaScript version number used within a specified JSContextcx. The version number is an enumerated value that corresponds to the JavaScript version string with which JS users are familiar.

The following table lists possible values reported by JS_GetVersion, the enumerated value you can use for the JS version in your code, and provides a translation to the actual JavaScript version string: TABLE BORDER="0" TRTD VALIGN='baseline' ALIGN='left' BValue /B/TDTD VALIGN='baseline' ALIGN='left' BEnumeration /B/TDTD VALIGN='baseline' ALIGN='left' BMeaning /B /TD/TRTR TD VALIGN='baseline' ALIGN='left'P CODE100/CODE/TDTD VALIGN='baseline' ALIGN='left'P CODEJSVERSION_1_0/CODE/TDTD VALIGN='baseline' ALIGN='left'P JavaScript 1.0/P /TD/TRTR TD VALIGN='baseline' ALIGN='left'P CODE110/CODE/TDTD VALIGN='baseline' ALIGN='left'P CODEJSVERSION_1_1/CODE/TDTD VALIGN='baseline' ALIGN='left'P JavaScript 1.1/P /TD/TRTR TD VALIGN='baseline' ALIGN='left'P CODE120/CODE/TDTD VALIGN='baseline' ALIGN='left'P CODEJSVERSION_1_2/CODE/TDTD VALIGN='baseline' ALIGN='left'P JavaScript 1.2/P /TD/TRTR TD VALIGN='baseline' ALIGN='left'P CODE130/CODE/TDTD VALIGN='baseline' ALIGN='left'P CODEJSVERSION_1_3/CODE/TDTD VALIGN='baseline' ALIGN='left'P JavaScript 1.3/P /TD/TRTR TD VALIGN='baseline' ALIGN='left'P CODE0/CODE/TDTD VALIGN='baseline' ALIGN='left'P CODEJSVERSION_DEFAULT/CODE/TDTD VALIGN='baseline' ALIGN='left'P Default JavaScript version/P /TD/TRTR TD VALIGN='baseline' ALIGN='left'P CODE-1/CODE/TDTD VALIGN='baseline' ALIGN='left'P CODEJSVERSION_UNKNOWN/CODE/TDTD VALIGN='baseline' ALIGN='left'P Unknown JavaScript version/P /TD/TR/TABLE  

If JSVERSION_DEFAULT is returned by JS_GetVersion, it indicates that the current script does not provide a version number and that the script is executed using the last known version number. If that version number is unknown because a script without a specified version is the first to execute, JS_GetVersion still returns JSVERSION_DEFAULT.


See also:
JS_SetVersion

[sh-index] Back to list of manuals