JSValue.newError constructor

JSValue.newError(
  1. JSContext ctx,
  2. String errorStr, {
  3. bool autoDispose = true,
})

Implementation

factory JSValue.newError(
  JSContext ctx,
  String errorStr, {
  bool autoDispose = true,
}) {
  final errorConstructor = ctx.globalObject.getPropertyStr('Error');
  return errorConstructor.callConstructor(
    argv: [JSValue.newString(ctx, errorStr)],
  );
}