Skip to content

Commit afd66d2

Browse files
committed
Refactor typeofEquals usage and remove isInstanceOfDomType
Closes #77 typeofEquals now takes a String and returns a bool, and instanceOfString is the canonical replacement for isInstanceOfDomType. Removes now unneeded test as well. Updates min SDK version.
1 parent 819f8b4 commit afd66d2

File tree

5 files changed

+6
-27
lines changed

5 files changed

+6
-27
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.2.2-wip
2+
3+
- Updates SDK version minimum to 3.2.0-194.0.dev.
4+
15
## 0.2.1-beta
26

37
- `helpers.dart`

lib/helpers.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,3 @@ external JSFunction get _audioConstructor;
5151
HTMLAudioElement createAudioElement() => _audioConstructor.callAsConstructor();
5252

5353
Element? querySelector(String selectors) => document.querySelector(selectors);
54-
55-
bool isInstanceOfDomType(JSObject? o, String domType) {
56-
if (o == null) return false;
57-
final constructor = globalContext[domType];
58-
if (constructor == null) return false;
59-
return o.instanceof(constructor as JSFunction).toDart;
60-
}

lib/src/helpers/events/providers.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ String _determineTransitionEventType(EventTarget e) {
612612
}
613613

614614
String _determineVisibilityChangeEventType(EventTarget e) {
615-
if (e.typeofEquals('undefined'.toJS).toDart) {
615+
if (e.typeofEquals('undefined')) {
616616
return 'visibilitychange';
617617
} else if (e.hasProperty('mozHidden'.toJS).toDart) {
618618
return 'mozvisibilitychange';

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version: 0.2.1-beta
66
repository: https://github.com/dart-lang/web
77

88
environment:
9-
sdk: ">=3.2.0-157.0.dev <4.0.0"
9+
sdk: ">=3.2.0-194.0.dev <4.0.0"
1010

1111
dev_dependencies:
1212
args: ^2.4.0

test/helpers_test.dart

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)