@@ -5,7 +5,6 @@ library kernel.ast_from_binary;
55
66import 'dart:core' hide MapEntry;
77import 'dart:developer' ;
8- import 'dart:convert' ;
98import 'dart:typed_data' ;
109
1110import '../ast.dart' ;
@@ -29,22 +28,11 @@ class InvalidKernelVersionError {
2928 InvalidKernelVersionError (this .version);
3029
3130 String toString () {
32- return 'Unexpected Kernel Format Version ${version } '
31+ return 'Unexpected Kernel version ${version } '
3332 '(expected ${Tag .BinaryFormatVersion }).' ;
3433 }
3534}
3635
37- class InvalidKernelSdkVersionError {
38- final String version;
39-
40- InvalidKernelSdkVersionError (this .version);
41-
42- String toString () {
43- return 'Unexpected Kernel SDK Version ${version } '
44- '(expected ${expectedSdkHash }).' ;
45- }
46- }
47-
4836class CompilationModeError {
4937 final String message;
5038
@@ -496,13 +484,6 @@ class BinaryBuilder {
496484 if (_bytes.length == 0 ) throw new StateError ("Empty input given." );
497485 }
498486
499- void _readAndVerifySdkHash () {
500- final sdkHash = ascii.decode (readBytes (sdkHashLength));
501- if (! isValidSdkHash (sdkHash)) {
502- throw InvalidKernelSdkVersionError (sdkHash);
503- }
504- }
505-
506487 /// Deserializes a kernel component and stores it in [component] .
507488 ///
508489 /// When linking with a non-empty component, canonical names must have been
@@ -530,9 +511,6 @@ class BinaryBuilder {
530511 if (version != Tag .BinaryFormatVersion ) {
531512 throw InvalidKernelVersionError (version);
532513 }
533-
534- _readAndVerifySdkHash ();
535-
536514 _byteOffset = offset;
537515 List <int > componentFileSizes = _indexComponents ();
538516 if (componentFileSizes.length > 1 ) {
@@ -716,8 +694,6 @@ class BinaryBuilder {
716694 throw InvalidKernelVersionError (formatVersion);
717695 }
718696
719- _readAndVerifySdkHash ();
720-
721697 // Read component index from the end of this ComponentFiles serialized data.
722698 _ComponentIndex index = _readComponentIndex (componentFileSize);
723699
@@ -742,8 +718,6 @@ class BinaryBuilder {
742718 throw InvalidKernelVersionError (formatVersion);
743719 }
744720
745- _readAndVerifySdkHash ();
746-
747721 List <String > problemsAsJson = readListOfStrings ();
748722 if (problemsAsJson != null ) {
749723 component.problemsAsJson ?? = < String > [];
0 commit comments