]> Cypherpunks repositories - gostls13.git/commitdiff
- missing changes from prev. commit
authorRobert Griesemer <gri@golang.org>
Fri, 18 Jul 2008 21:23:04 +0000 (14:23 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 18 Jul 2008 21:23:04 +0000 (14:23 -0700)
SVN=128064

usr/gri/gosrc/export.go

index 1492ee6acab5298e491cc946f8ba4a9a52b0168f..0740e1b23d28c2f6ed49225ae719c5f1c477ab09 100755 (executable)
@@ -260,16 +260,16 @@ func (E *Exporter) WritePackage(pkg *Globals.Package) {
 
 
 func (E *Exporter) Export(comp* Globals.Compilation, file_name string) {
+       if E.debug {
+               print "exporting to ", file_name;
+       }
+
        E.comp = comp;
        E.debug = true;
        E.pos = 0;
        E.pkg_ref = 0;
        E.type_ref = 0;
        
-       if E.debug {
-               print "exporting to ", file_name;
-       }
-
        // Predeclared types are "pre-exported".
        // TODO run the loop below only in debug mode
        {       i := 0;
@@ -297,4 +297,8 @@ func (E *Exporter) Export(comp* Globals.Compilation, file_name string) {
        
        data := string(E.buf)[0 : E.pos];
        ok := sys.writefile(file_name, data);
+       
+       if !ok {
+               panic "export failed";
+       }
 }