time-to-botec/js/node_modules/@stdlib/assert/is-syntax-error/docs/repl.txt

31 lines
751 B
Plaintext
Raw Permalink Normal View History

{{alias}}( value )
Tests if a value is a SyntaxError object.
This function should *not* be considered robust. While the function should
always return `true` if provided a SyntaxError (or a descendant) object,
false positives may occur due to the fact that the SyntaxError constructor
inherits from Error and has no internal class of its own. Hence, SyntaxError
impersonation is possible.
Parameters
----------
value: any
Value to test.
Returns
-------
bool: boolean
Boolean indicating whether value is a SyntaxError object.
Examples
--------
> var bool = {{alias}}( new SyntaxError( 'beep' ) )
true
> bool = {{alias}}( {} )
false
See Also
--------