Obsolete since JSAPI 25
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Configure a JSContext to use a specific version of the JavaScript language.

Syntax

JSVersion
JS_SetVersion(JSContext *cx, JSVersion version);
Name Type Description
cx JSContext * Pointer to a JS context from which to derive runtime information.
version JSVersion Version of JavaScript to set context to.

Description

JS_SetVersion attempts to set the version of JavaScript to version for a specified executable script context, cx. The version comes from the JSVersion enumerated type.

JS_SetVersion returns the JS version in effect for the context before you changed it.

See Also