From eb75e8d96ad442d5e32b963d4418816c8f63e90d Mon Sep 17 00:00:00 2001 From: jmoenig Date: Thu, 24 Jun 2021 16:07:21 +0200 Subject: [PATCH] removed unused code --- HISTORY.md | 1 + snap.html | 6 +++--- src/byob.js | 7 +------ src/store.js | 13 +------------ src/threads.js | 7 +------ 5 files changed, 7 insertions(+), 27 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 7b1390e3..cb0949ba 100755 --- a/HISTORY.md +++ b/HISTORY.md @@ -12,6 +12,7 @@ ### 2021-06-24 * extensions: tweaked loading unlisted script-extensions +* byob, threads, store: removed unused code ### 2021-06-23 * updated bignums library diff --git a/snap.html b/snap.html index 245fc6d5..42a950dd 100755 --- a/snap.html +++ b/snap.html @@ -9,19 +9,19 @@ - + - + - + diff --git a/src/byob.js b/src/byob.js index ecfc4e73..62d6d25b 100644 --- a/src/byob.js +++ b/src/byob.js @@ -106,7 +106,7 @@ WatcherMorph, XML_Serializer, SnapTranslator, SnapExtensions*/ // Global stuff //////////////////////////////////////////////////////// -modules.byob = '2021-June-19'; +modules.byob = '2021-June-24'; // Declarations @@ -347,11 +347,6 @@ CustomBlockDefinition.prototype.parseChoices = function (string) { if (string.match(/^function\s*\(.*\)\s*{.*\n/)) { // It's a JS function definition. // Let's extract its params and body, and return a Function out of them. - /* - if (!Process.prototype.enableJS) { - throw new Error('JavaScript is not enabled'); - } - */ params = string.match(/^function\s*\((.*)\)/)[1].split(','); body = string.split('\n').slice(1,-1).join('\n'); return Function.apply(null, params.concat([body])); diff --git a/src/store.js b/src/store.js index c2aabea7..fb7bc2f4 100644 --- a/src/store.js +++ b/src/store.js @@ -61,7 +61,7 @@ normalizeCanvas, contains*/ // Global stuff //////////////////////////////////////////////////////// -modules.store = '2021-June-10'; +modules.store = '2021-June-24'; // XML_Serializer /////////////////////////////////////////////////////// @@ -1164,17 +1164,6 @@ SnapSerializer.prototype.loadBlock = function (model, isReporter, object) { model.attributes['var'] ); } else { - // disable loading JavaScript functions - /* - if (model.attributes.s === 'reportJSFunction' && - !Process.prototype.enableJS) { - if (window.confirm('enable JavaScript?')) { - Process.prototype.enableJS = true; - } else { - throw new Error('JavaScript is not enabled'); - } - } - */ block = SpriteMorph.prototype.blockForSelector(model.attributes.s); migration = SpriteMorph.prototype.blockMigrations[ model.attributes.s diff --git a/src/threads.js b/src/threads.js index 216eedd1..7b3b5bc8 100644 --- a/src/threads.js +++ b/src/threads.js @@ -62,7 +62,7 @@ isNil, WatcherMorph, List, ListWatcherMorph, alert, console, TableMorph, BLACK, TableFrameMorph, ColorSlotMorph, isSnapObject, newCanvas, Symbol, SVG_Costume, SnapExtensions*/ -modules.threads = '2021-June-18'; +modules.threads = '2021-June-24'; var ThreadManager; var Process; @@ -1254,11 +1254,6 @@ Process.prototype.evaluate = function ( return this.returnValueToParentContext(null); } if (context instanceof Function) { - /* - if (!this.enableJS) { - throw new Error('JavaScript extensions for Snap!\nare turned off'); - } - */ return context.apply( this.blockReceiver(), args.itemsArray().concat([this])