Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

JS_ValueToSource

This article needs a technical review. How you can help.

Convert a JS::Value to a JavaScript source.

Syntax

JSString *
JS_ValueToSource(JSContext *cx, JS::Handle<JS::Value> v);
Name Type Description
cx JSContext * The context in which to perform the conversion. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext.
v JS::Handle<JS::Value> The value to convert.

Description

JS_ValueToSource converts a specified JavaScript value, v, to a JavaScript source.

On success, JS_ValueToSource returns a pointer to a string. On error or exception, it returns NULL. This happens, for example, if v is an object and v.toSource() throws an exception.

See Also

Document Tags and Contributors

 Contributors to this page: kscarfone, arai
 Last updated by: kscarfone,