From 82f0c1c46dfdba5edf7c5fa84456233121dd69e1 Mon Sep 17 00:00:00 2001 From: Devon Carew Date: Thu, 31 Aug 2023 16:13:58 -0700 Subject: [PATCH] fix nullability of some type annotations (#110) * fix nullability of some type annotations * fix branch name --- .github/workflows/publish.yaml | 2 +- CHANGELOG.md | 6 ++++++ lib/src/runtime.dart | 9 ++++----- pubspec.yaml | 4 ++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 01ba8f4..d5146d7 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -5,7 +5,7 @@ name: Publish on: # Trigger on pull requests that target the default branch. pull_request: - branches: [ master ] + branches: [ main ] types: [opened, synchronize, reopened, labeled, unlabeled] # Also, trigger when tags are pushed to the repo. push: diff --git a/CHANGELOG.md b/CHANGELOG.md index 1301a48..1e1a570 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 1.2.1 + +- Make the return type of `runtime`'s `ExceptionDetails.url` field nullable. +- Make the return type of `runtime`'s `StackTrace.description` field nullable. +- Increase required SDK to 3.0.0. + ## 1.2.0 - Introduce an optional `onError` parameter when setting up a [WipConnection]. diff --git a/lib/src/runtime.dart b/lib/src/runtime.dart index ada5399..3be4e44 100644 --- a/lib/src/runtime.dart +++ b/lib/src/runtime.dart @@ -237,7 +237,7 @@ class ExceptionDetails implements Exception { /// URL of the exception location, to be used when the script was not /// reported. @optional - String get url => json['url'] as String; + String? get url => json['url'] as String?; /// Script ID of the exception location. @optional @@ -272,14 +272,13 @@ class StackTrace { /// String label of this stack trace. For async traces this may be a name of /// the function that initiated the async call. @optional - String get description => json['description'] as String; + String? get description => json['description'] as String?; /// Asynchronous JavaScript stack trace that preceded this stack, if /// available. @optional - StackTrace? get parent { - return json['parent'] == null ? null : StackTrace(json['parent']); - } + StackTrace? get parent => + json['parent'] == null ? null : StackTrace(json['parent']); List printFrames() { List frames = callFrames; diff --git a/pubspec.yaml b/pubspec.yaml index abcacc0..29397fd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,12 +1,12 @@ name: webkit_inspection_protocol -version: 1.2.0 +version: 1.2.1 description: > A client for the Chrome DevTools Protocol (previously called the Webkit Inspection Protocol). repository: https://github.com/google/webkit_inspection_protocol.dart environment: - sdk: '>=2.12.0 <3.0.0' + sdk: ^3.0.0 dependencies: logging: ^1.0.0