diff --git a/example/daemon/www/js/connection.js b/example/daemon/www/js/connection.js index 1f4117c..e0480d2 100644 --- a/example/daemon/www/js/connection.js +++ b/example/daemon/www/js/connection.js @@ -1,3 +1,5 @@ +/* exported Connection */ + class Connection { constructor() { diff --git a/example/daemon/www/js/connection_view.js b/example/daemon/www/js/connection_view.js index 34e4e66..d9b1fba 100644 --- a/example/daemon/www/js/connection_view.js +++ b/example/daemon/www/js/connection_view.js @@ -1,3 +1,5 @@ +/* exported ConnectionView */ + class ConnectionView { constructor(connection) { this.connection = connection; diff --git a/example/daemon/www/js/filesystem.js b/example/daemon/www/js/filesystem.js index 3c122db..4114052 100644 --- a/example/daemon/www/js/filesystem.js +++ b/example/daemon/www/js/filesystem.js @@ -1,3 +1,6 @@ +/* exported FileSystem */ +/* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */ + class FileSystem { static get GOOD() { return 0; } static get BAD() { return 1; } @@ -104,7 +107,7 @@ class FileSystem { return result; } - close(inode, handle, mode) { + close(_inode, _handle, _mode) { // do nothing return true; } diff --git a/example/daemon/www/js/filesystem_handler.js b/example/daemon/www/js/filesystem_handler.js index ff3aadf..0d68979 100644 --- a/example/daemon/www/js/filesystem_handler.js +++ b/example/daemon/www/js/filesystem_handler.js @@ -1,3 +1,5 @@ +/* exported FileSystemHandler */ +/* eslint no-console: "off" */ class FileSystemHandler { diff --git a/example/daemon/www/js/package.json b/example/daemon/www/js/package.json index 9ac3585..276764e 100644 --- a/example/daemon/www/js/package.json +++ b/example/daemon/www/js/package.json @@ -2,7 +2,7 @@ "name": "wsfs-provider", "version": "0.1.0", "description": "Provider for websocket filesystem (wsfs)", - "main": "filesystem.js", + "main": "startup.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/example/daemon/www/js/startup.js b/example/daemon/www/js/startup.js index 535f4a5..0444e6f 100644 --- a/example/daemon/www/js/startup.js +++ b/example/daemon/www/js/startup.js @@ -1,3 +1,9 @@ +/* global Connection, ConnectionView, FileSystem, FileSystemHandler */ + +function mode(value) { + return parseInt(value, 8); +} + function startup() { let connection = new Connection(); let connectionView = new ConnectionView(connection); @@ -5,16 +11,15 @@ function startup() { let fs = new FileSystem({ inode: 1, - mode: 0755, + mode: mode("0755"), type: "dir", entries: { - "hello.txt" : { inode: 2, mode: 0444, type: "file", contents: "Hello, World!"}, - "say_hello.sh": { inode: 3, mode: 0555, type: "file", contents: "#!/bin/sh\necho hello\n"} + "hello.txt" : { inode: 2, mode: mode("0444"), type: "file", contents: "Hello, World!"}, + "say_hello.sh": { inode: 3, mode: mode("0555"), type: "file", contents: "#!/bin/sh\necho hello\n"} } }); + let handler = new FileSystemHandler(fs, connection); - - } window.onload = startup;