error property
JSError
get
error
Implementation
JSError get error {
assert(shouldThrow);
final JSValue exceptionValue = JSValue(_context, _ref[0]);
final JSObject object = exceptionValue.object;
if (exceptionValue.isError) {
final JSValue message = object.getProperty('message');
final JSValue stack = object.getProperty('stack');
final JSValue name = object.getProperty('name');
final String? stackString = stack.string;
return JSError(name.string, message.string ?? '', stackString != null ? StackTrace.fromString(stackString) : null);
} else {
return JSError(null, object.value.string ?? '');
}
}