Skip to main content

EvalError

Alias to native globalThis.EvalError

The EvalError object indicates an error regarding the global eval() function. This exception is not thrown by JavaScript anymore, however the EvalError object remains for compatibility.

@example
import { EvalError } from '@w5s/error';

try {
throw new EvalError("Hello");
} catch (e) {
console.log(e instanceof RangeEvalErrorError); // true
console.log(e.message); // "Hello"
console.log(e.name); // "EvalError"
console.log(e.stack); // Stack of the error
}

Hierarchy

  • Error
    • EvalError

Index

Constructors

Properties

Constructors

externalconstructor

  • new EvalError(message?: string): EvalError
  • new EvalError(message?: string, options?: ErrorOptions): EvalError

Properties

name

name: EvalError
Page Options