Updated examples.

This commit is contained in:
Alan Kligman 2012-10-15 11:33:56 -04:00
parent cb370a0ede
commit be724d2b24
2 changed files with 2 additions and 47 deletions

View File

@ -1,45 +0,0 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<div id="stdout"></div>
</body>
<script src="../lib/require.js"></script>
<script>
require.config({
baseUrl: "../lib",
paths: {
"src": "../src"
}
});
require(["src/buffer"], function(Buffer) {
try {
/*
var string1 = "\u00BD + \u00BC";
var string2 = " = \u00BE";
var buffer1 = new Buffer(string1);
var buffer2 = new Buffer(string2);
console.log(buffer1.toString(), ";", buffer2.toString());
var buffer3 = Buffer.concat([buffer1, buffer2]);
console.log(buffer3.toString());
var buffer4 = buffer3.slice(0, 7);
console.log(buffer4.toString());
*/
var buffer = new Buffer(4);
buffer.writeUInt32LE(0xDEADBEEF, 0);
console.log(0xDEADBEEF | 0x0);
console.log(buffer.readUInt32LE(0));
buffer.writeUInt32BE(0xDEADBEEF, 0);
console.log(buffer.readUInt32BE(0));
// console.log(buffer.readUInt16LE(0));
} catch(e) {
console.log(e);
}
});
</script>
</html>

View File

@ -15,7 +15,7 @@ require.config({
}
});
require(["src/filesystem", "src/buffer"], function(IDBFS, Buffer) {
require(["src/filesystem"], function(IDBFS) {
IDBFS.mount("default", function(error, fs) {
fs.mkdir("/tmp", function(error) {
@ -49,4 +49,4 @@ require(["src/filesystem", "src/buffer"], function(IDBFS, Buffer) {
});
</script>
</html>
</html>