George S. Baugh 5 년 전
부모
커밋
c28a507502
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      lib/Playwright.pm

+ 2 - 1
lib/Playwright.pm

@@ -200,7 +200,7 @@ sub launch ($self, %args) {
     return $msg;
 }
 
-=head2 await (Playwright::Promise) = MIXED
+=head2 await (AsyncData) = Object
 
 Waits for an asynchronous operation returned by the waitFor* methods to complete and returns the value.
 
@@ -210,6 +210,7 @@ sub await ($self, $promise) {
     confess("Input must be an AsyncData") unless $promise->isa('AsyncData');
     my $obj = $promise->result(1);
     my $class = "Playwright::$obj->{_type}";
+    return $obj unless $class;
     return $class->new( type => $obj->{_type}, id => $obj->{_guid}, handle => $self ); 
 }