Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Unified Diff: sdk/lib/_internal/pub_generated/lib/src/validator/utf8_readme.dart

Issue 557563002: Store the async-await compiled pub code directly in the repo. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub_generated/lib/src/validator/utf8_readme.dart
diff --git a/sdk/lib/_internal/pub_generated/lib/src/validator/utf8_readme.dart b/sdk/lib/_internal/pub_generated/lib/src/validator/utf8_readme.dart
new file mode 100644
index 0000000000000000000000000000000000000000..2f81ba5729b5cf2641ab369f8c1d46de5ef19152
--- /dev/null
+++ b/sdk/lib/_internal/pub_generated/lib/src/validator/utf8_readme.dart
@@ -0,0 +1,24 @@
+library pub.validator.utf8_readme;
+import 'dart:async';
+import 'dart:convert';
+import '../entrypoint.dart';
+import '../io.dart';
+import '../utils.dart';
+import '../validator.dart';
+class Utf8ReadmeValidator extends Validator {
+ Utf8ReadmeValidator(Entrypoint entrypoint) : super(entrypoint);
+ Future validate() {
+ return syncFuture(() {
+ var readme = entrypoint.root.readmePath;
+ if (readme == null) return;
+ var bytes = readBinaryFile(readme);
+ try {
+ UTF8.decode(bytes);
+ } on FormatException catch (_) {
+ warnings.add(
+ "$readme contains invalid UTF-8.\n"
+ "This will cause it to be displayed incorrectly on " "pub.dartlang.org.");
+ }
+ });
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698