Fix the CanvasPath::CreateNew signature to avoid unnecessary Dart API::NewError calls (flutter/engine#32791)

This commit is contained in:
Jason Simmons
2022-04-20 07:24:04 -07:00
committed by GitHub
parent 5c197a250a
commit c8aa503a12
2 changed files with 4 additions and 2 deletions

View File

@@ -24,7 +24,7 @@ class CanvasPath : public RefCountedDartWrappable<CanvasPath> {
public:
~CanvasPath() override;
static fml::RefPtr<CanvasPath> CreateNew(Dart_Handle path_handle) {
static fml::RefPtr<CanvasPath> CreateNew() {
return fml::MakeRefCounted<CanvasPath>();
}

View File

@@ -560,7 +560,9 @@ struct DartConverter<Dart_Handle> {
static NativeType FromArguments(Dart_NativeArguments args,
int index,
Dart_Handle& exception) {
return Dart_GetNativeArgument(args, index);
Dart_Handle result = Dart_GetNativeArgument(args, index);
TONIC_DCHECK(!Dart_IsError(result));
return result;
}
static NativeType FromFfi(FfiType val) { return val; }