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

JS_StringEqualsAscii

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

This article covers features introduced in SpiderMonkey 1.8.5

Compare flat string and ASCII string.

Syntax

bool
JS_StringEqualsAscii(JSContext *cx, JSString *str, const char *asciiBytes, bool *match);

bool
JS_FlatStringEqualsAscii(JSFlatString *str, const char *asciiBytes);
Name Type Description
cx JSContext * A context. Requires request. In a JS_THREADSAFE build, the caller must be in a request on this JSContext.
str JSFlatString * String to compare.
asciiBytes const char * ASCII string to compare with.
match bool * (JS_StringEqualsAscii only) Out parameter. Received the comparison result.

Description

JS_StringEqualsAscii and JS_FlatStringEqualsAscii compare string str and ASCII string asciiBytes.

On successful, JS_StringEqualsAscii stores the comparison result into *match and returns true, otherwise returns false.

JS_FlatStringEqualsAscii always succeeds, and returns the comparison result.

See Also

Document Tags and Contributors

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