WPEJavaScriptCore.Context.check_syntax

### Method

# WPEJavaScriptCore Contextcheck_syntax

#### Declaration [src]

    JSCCheckSyntaxResult
    jsc_context_check_syntax (
      JSCContext* context,
      const char* code,
      gssize length,
      JSCCheckSyntaxMode mode,
      const char* uri,
      unsigned line_number,
      JSCException** exception
    )

#### Description [src]

Check the given `code` in `context` for syntax errors. The `line_number` is the starting line number in `uri`; the value is one-based so the first line is 1. `uri` and `line_number` are only used to fill the `exception`. In case of errors `exception` will be set to a new `JSCException` with the details. You can pass `NULL` to `exception` to ignore the error details.

#### Parameters

`code`

  Type: `const char*`

  A JavaScript script to check.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`length`

  Type: `gssize`

  Length of `code`, or -1 if `code` is a nul-terminated string.

`mode`

  Type: `JSCCheckSyntaxMode`

  A `JSCCheckSyntaxMode`.

`uri`

  Type: `const char*`

  The source URI.

  The data is owned by the caller of the method.
  The value is a NUL terminated UTF-8 string.

`line_number`

  Type: `unsigned`

  The starting line number.

`exception`

  Type: `JSCException`

  Return location for a `JSCException`, or `NULL` to ignore.

  The argument will be set by the function.
  The argument can be `NULL`.
  The caller of the method takes ownership of the returned data, and is responsible for freeing it.

#### Return value

Type: `JSCCheckSyntaxResult`

A `JSCCheckSyntaxResult`.