Make peek return null when the stack is empty

Change-Id: I73cea25140ad1123ff1a8cb1bca1c69742d3d6f7
Reviewed-on: https://dart-review.googlesource.com/56201
Reviewed-by: Dan Rubel <danrubel@google.com>
Reviewed-by: Peter von der Ahé <ahe@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
diff --git a/pkg/front_end/lib/src/fasta/source/stack_listener.dart b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
index f312680..ef9eda1 100644
--- a/pkg/front_end/lib/src/fasta/source/stack_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/stack_listener.dart
@@ -111,7 +111,7 @@
     if (tokenOrNull == null) stack.push(nullValue);
   }
 
-  Object peek() => stack.last;
+  Object peek() => stack.isNotEmpty ? stack.last : null;
 
   Object pop([NullValue nullValue]) {
     return stack.pop(nullValue);