Index: pkg/kernel/lib/kernel.dart |
diff --git a/pkg/kernel/lib/kernel.dart b/pkg/kernel/lib/kernel.dart |
index 752617b9d3fc2ed5ee541fd11667fa9026c92417..48af8f45c6d20bc1c52f226c4a46771aa559fc1a 100644 |
--- a/pkg/kernel/lib/kernel.dart |
+++ b/pkg/kernel/lib/kernel.dart |
@@ -23,8 +23,13 @@ import 'text/ast_to_text.dart'; |
export 'ast.dart'; |
Program loadProgramFromBinary(String path, [Program program]) { |
+ List<int> bytes = new File(path).readAsBytesSync(); |
+ return loadProgramFromBytes(bytes, program); |
+} |
+ |
+Program loadProgramFromBytes(List<int> bytes, [Program program]) { |
program ??= new Program(); |
- new BinaryBuilder(new File(path).readAsBytesSync()).readProgram(program); |
+ new BinaryBuilder(bytes).readProgram(program); |
return program; |
} |