From 7966b81830aec7befad99ed1cf81990b4cf74fab Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sat, 20 Jul 2019 19:18:23 +0900 Subject: [PATCH] Fixed benchmark --- desktop/sources/scripts/commander.js | 5 +++-- desktop/sources/scripts/library.js | 2 +- desktop/sources/scripts/source.js | 6 +----- examples/benchmark.lisp | 4 ++-- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/desktop/sources/scripts/commander.js b/desktop/sources/scripts/commander.js index 95892a5..f42d1d1 100644 --- a/desktop/sources/scripts/commander.js +++ b/desktop/sources/scripts/commander.js @@ -35,12 +35,13 @@ function Commander (ronin) { if (txt.indexOf('$') > -1) { ronin.log('Present: $'); return } const inter = new Lisp(txt, ronin.library) inter.toPixels() - ronin.always && requestAnimationFrame(() => this.run(txt)) + ronin.always === true && requestAnimationFrame(() => this.run(txt)) } this.load = function (txt) { + ronin.animate(false) this._input.value = txt - this.run() + this.run(txt) } this.reindent = function () { diff --git a/desktop/sources/scripts/library.js b/desktop/sources/scripts/library.js index ea3483a..f9cf304 100644 --- a/desktop/sources/scripts/library.js +++ b/desktop/sources/scripts/library.js @@ -324,7 +324,7 @@ function Library (ronin) { this.open = async (path) => { // Imports a graphic file and resizes the frame. return ronin.surface.open(path) } - + // File System this.dir = (path = ronin.source.path) => { // Returns the content of a directory. diff --git a/desktop/sources/scripts/source.js b/desktop/sources/scripts/source.js index c6bfd72..d0abb44 100644 --- a/desktop/sources/scripts/source.js +++ b/desktop/sources/scripts/source.js @@ -66,7 +66,7 @@ function Source (ronin) { if (!fs.existsSync(loc)) { console.warn('Source', 'File does not exist: ' + loc); return } console.log('Source', 'Reading ' + loc) this.path = loc - this.load(fs.readFileSync(this.path, 'utf8')) + ronin.commander.load(fs.readFileSync(this.path, 'utf8')) ronin.log(`Reading file.`) } @@ -74,10 +74,6 @@ function Source (ronin) { ronin.commander.run() } - this.load = function (data) { - ronin.commander._input.value = data - } - this.quit = function (force = false) { if (this.hasChanges() === true && force === false) { this.verify() diff --git a/examples/benchmark.lisp b/examples/benchmark.lisp index ab6fa3d..70832bf 100644 --- a/examples/benchmark.lisp +++ b/examples/benchmark.lisp @@ -56,6 +56,6 @@ (test "str" (str 1 4 "-" (add 3 4) ".jpg") "14-7.jpg") ; Interop - (test "interop" ((of (of js "Math") "max") 2 4) 4) - (test "recursive key selector" ((of js "Math" "max") 2 4) 4) + (test "interop" ((of (of (js) "Math") "max") 2 4) 4) + (test "recursive key selector" ((of (js) "Math" "max") 2 4) 4) ) \ No newline at end of file