Skip to content
Permalink
Browse files

Changed readFile to java-based read function to handle \r\n, fixes do…

…cs and test, lite still broken
  • Loading branch information
jzaefferer committed Oct 8, 2006
1 parent c26ae24 commit 012153008398ea8fe57c19184d807250b38164a0
Showing with 14 additions and 2 deletions.
  1. +1 −1 build/docs/docs.js
  2. +12 −0 build/js/writeFile.js
  3. +1 −1 build/test/test.js
@@ -2,7 +2,7 @@ load("build/js/json.js", "build/js/xml.js", "build/js/writeFile.js", "build/js/p

var dir = arguments[1];

var c = parse( readFile(arguments[0]) );
var c = parse( read(arguments[0]) );
output( c, "docs" );

c = categorize( c );
@@ -5,3 +5,15 @@ function writeFile( file, stream ) {
buffer.print( stream );
buffer.close();
}

function read( file ) {
var jq = new File(file);
var reader = new BufferedReader(new FileReader(jq));
var line = null;
var buffer = new java.lang.StringBuffer(jq.length());
while( (line = reader.readLine()) != null) {
buffer.append(line);
buffer.append("\n");
}
return buffer.toString();
}
@@ -16,7 +16,7 @@ function addTestWrapper(name, test) {
}

var dir = arguments[1];
var jq = parse( readFile( arguments[0] ) );
var jq = parse( read(arguments[0]) );

var testFile = [];

0 comments on commit 0121530

Please sign in to comment.
You can’t perform that action at this time.