-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch dart:js and some dart:js_util usages to use static interop (#3299
- Loading branch information
Showing
9 changed files
with
3,037 additions
and
3,277 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'package:js/js.dart'; | ||
|
||
void init() { | ||
highlight?.highlightAll(); | ||
} | ||
|
||
@JS() | ||
@staticInterop | ||
class HighlightJs {} | ||
|
||
extension HighlightJsExtension on HighlightJs { | ||
external void highlightAll(); | ||
} | ||
|
||
@JS('hljs') | ||
external HighlightJs? get highlight; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
C6415C6028582DE4EC42B10F54BE3554 | ||
6EB4A5A121E44E4224AB759B79E251E7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
import 'dart:js_util' as js_util; | ||
|
||
import 'package:js/js.dart'; | ||
|
||
@JS('Response') | ||
@staticInterop | ||
class FetchResponse {} | ||
|
||
extension FetchResponseExtension on FetchResponse { | ||
external int get status; | ||
|
||
@JS('text') | ||
external Promise _text(); | ||
Future<String> get text => js_util.promiseToFuture(_text()); | ||
} | ||
|
||
@JS() | ||
@staticInterop | ||
class Promise {} |