From f22a1dfd5e5a34d2abd9d8a773cfc3bb09849ce5 Mon Sep 17 00:00:00 2001 From: Falk Werner Date: Wed, 20 Feb 2019 20:23:56 +0100 Subject: [PATCH] switched to ECMAScript modules --- example/daemon/www/index.html | 6 +----- example/daemon/www/js/.eslintrc.js | 3 ++- example/daemon/www/js/connection.js | 4 +--- example/daemon/www/js/connection_view.js | 4 +--- example/daemon/www/js/filesystem.js | 3 +-- example/daemon/www/js/filesystem_handler.js | 3 +-- example/daemon/www/js/startup.js | 6 +++++- 7 files changed, 12 insertions(+), 17 deletions(-) diff --git a/example/daemon/www/index.html b/example/daemon/www/index.html index 713f1a6..67e50f9 100644 --- a/example/daemon/www/index.html +++ b/example/daemon/www/index.html @@ -3,11 +3,7 @@ LWS Example - - - - - + diff --git a/example/daemon/www/js/.eslintrc.js b/example/daemon/www/js/.eslintrc.js index e5e95a1..b5171ab 100644 --- a/example/daemon/www/js/.eslintrc.js +++ b/example/daemon/www/js/.eslintrc.js @@ -9,7 +9,8 @@ module.exports = { "SharedArrayBuffer": "readonly" }, "parserOptions": { - "ecmaVersion": 2018 + "ecmaVersion": 2018, + "sourceType": "module" }, "rules": { "accessor-pairs": "error", diff --git a/example/daemon/www/js/connection.js b/example/daemon/www/js/connection.js index e0480d2..991bb96 100644 --- a/example/daemon/www/js/connection.js +++ b/example/daemon/www/js/connection.js @@ -1,6 +1,4 @@ -/* exported Connection */ - -class Connection { +export class Connection { constructor() { this.ws = null; diff --git a/example/daemon/www/js/connection_view.js b/example/daemon/www/js/connection_view.js index d9b1fba..219803c 100644 --- a/example/daemon/www/js/connection_view.js +++ b/example/daemon/www/js/connection_view.js @@ -1,6 +1,4 @@ -/* exported ConnectionView */ - -class ConnectionView { +export class ConnectionView { constructor(connection) { this.connection = connection; this.connection.onclose = () => { this.onConnectionClosed(); }; diff --git a/example/daemon/www/js/filesystem.js b/example/daemon/www/js/filesystem.js index 4114052..8393026 100644 --- a/example/daemon/www/js/filesystem.js +++ b/example/daemon/www/js/filesystem.js @@ -1,7 +1,6 @@ -/* exported FileSystem */ /* eslint no-unused-vars: ["error", { "argsIgnorePattern": "^_" }] */ -class FileSystem { +export class FileSystem { static get GOOD() { return 0; } static get BAD() { return 1; } diff --git a/example/daemon/www/js/filesystem_handler.js b/example/daemon/www/js/filesystem_handler.js index 0d68979..017c047 100644 --- a/example/daemon/www/js/filesystem_handler.js +++ b/example/daemon/www/js/filesystem_handler.js @@ -1,7 +1,6 @@ -/* exported FileSystemHandler */ /* eslint no-console: "off" */ -class FileSystemHandler { +export class FileSystemHandler { constructor(filesystem, connection) { this._fs = filesystem; diff --git a/example/daemon/www/js/startup.js b/example/daemon/www/js/startup.js index 0444e6f..29ffab6 100644 --- a/example/daemon/www/js/startup.js +++ b/example/daemon/www/js/startup.js @@ -1,4 +1,8 @@ -/* global Connection, ConnectionView, FileSystem, FileSystemHandler */ +import { Connection } from "./connection.js"; +import { ConnectionView } from "./connection_view.js"; +import { FileSystem } from "./filesystem.js"; +import { FileSystemHandler } from "./filesystem_handler.js"; + function mode(value) { return parseInt(value, 8);