Skip to content

Commit

Permalink
fix nullability of some type annotations (#110)
Browse files Browse the repository at this point in the history
* fix nullability of some type annotations

* fix branch name
  • Loading branch information
devoncarew authored Aug 31, 2023
1 parent 0458999 commit 82f0c1c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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].
Expand Down
9 changes: 4 additions & 5 deletions lib/src/runtime.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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<String> printFrames() {
List<CallFrame> frames = callFrames;
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 82f0c1c

Please sign in to comment.