Index: sdk/lib/_internal/pub/lib/src/utils.dart |
diff --git a/sdk/lib/_internal/pub/lib/src/utils.dart b/sdk/lib/_internal/pub/lib/src/utils.dart |
index 6f904c32459a2a70f76ec5c90d26901e58c42278..24c9ecfc76ed0d6f42d327540f52cd139e2ab65e 100644 |
--- a/sdk/lib/_internal/pub/lib/src/utils.dart |
+++ b/sdk/lib/_internal/pub/lib/src/utils.dart |
@@ -714,6 +714,15 @@ String prefixLines(String text, {String prefix: '| ', String firstPrefix}) { |
/// test that has explicitly set this. |
bool runningAsTest = Platform.environment.containsKey('_PUB_TESTING'); |
+/// Whether today is April Fools' day. |
+bool get isAprilFools { |
+ // Tests should never see April Fools' output. |
+ if (runningAsTest) return false; |
+ |
+ var date = new DateTime.now(); |
+ return date.month == 4 && date.day == 1; |
+} |
+ |
/// Wraps [fn] to guard against several different kinds of stack overflow |
/// exceptions: |
/// |