Skip to content

Commit af7a315

Browse files
committed
"use strict" is a Good Idea
1 parent 21c3ef6 commit af7a315

20 files changed

+38
-18
lines changed

jit.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module('users.bert.SqueakJS.jit').requires("users.bert.SqueakJS.vm").toRun(function() {
2+
"use strict";
23
/*
34
* Copyright (c) 2014 Bert Freudenberg
45
*

plugins/ADPCMCodecPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.ADPCMCodecPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/B2DPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.B2DPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/BitBltPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.BitBltPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/FFTPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.FFTPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/FloatArrayPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.FloatArrayPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/GeniePlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.GeniePlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/JPEGReaderPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.JPEGReaderPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/KedamaPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.KedamaPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/KedamaPlugin2.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.KedamaPlugin2").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/Klatt.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.Klatt").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/LargeIntegers.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.LargeIntegers").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/Matrix2x3Plugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.Matrix2x3Plugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/MiscPrimitivePlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.MiscPrimitivePlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/ScratchPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.ScratchPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/SoundGenerationPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.SoundGenerationPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/StarSqueakPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.StarSqueakPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

plugins/ZipPlugin.js

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
module("users.bert.SqueakJS.plugins.ZipPlugin").requires("users.bert.SqueakJS.vm").toRun(function() {
9+
"use strict";
910

1011
var VM_PROXY_MAJOR = 1;
1112
var VM_PROXY_MINOR = 11;

squeak.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
* THE SOFTWARE.
2121
*/
2222

23+
"use strict";
2324

2425
//////////////////////////////////////////////////////////////////////////////
2526
// these functions fake the Lively module and class system
2627
// just enough so the loading of vm.js succeeds
2728
//////////////////////////////////////////////////////////////////////////////
2829

29-
module = function(dottedPath) {
30+
window.module = function(dottedPath) {
3031
if (dottedPath == "") return window;
3132
var path = dottedPath.split("."),
3233
name = path.pop(),

vm.js

+18-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module('users.bert.SqueakJS.vm').requires().toRun(function() {
2+
"use strict";
23
/*
34
* Copyright (c) 2013,2014 Bert Freudenberg
45
*
@@ -559,19 +560,19 @@ Object.extend(Squeak,
559560
var path = this.splitFilePath(dirpath),
560561
localEntries = localStorage["squeak:" + path.fullname],
561562
template = includeTemplates && localStorage["squeak-template:" + path.fullname];
562-
if (localEntries || template) {
563-
var dir = {};
564-
function addEntries(entries) {
565-
for (var key in entries) {
566-
if (entries.hasOwnProperty(key)) {
567-
var entry = entries[key];
568-
dir[entry[0]] = entry;
569-
}
563+
function addEntries(dir, entries) {
564+
for (var key in entries) {
565+
if (entries.hasOwnProperty(key)) {
566+
var entry = entries[key];
567+
dir[entry[0]] = entry;
570568
}
571569
}
570+
}
571+
if (localEntries || template) {
572572
// local entries override templates
573-
if (template) addEntries(JSON.parse(template).entries);
574-
if (localEntries) addEntries(JSON.parse(localEntries));
573+
var dir = {};
574+
if (template) addEntries(dir, JSON.parse(template).entries);
575+
if (localEntries) addEntries(dir, JSON.parse(localEntries));
575576
return dir;
576577
}
577578
if (path.fullname == "/") return {};
@@ -899,17 +900,17 @@ Object.subclass('Squeak.Image',
899900
return false; // don't do more
900901
}
901902
};
903+
function mapSomeObjectsAsync() {
904+
if (mapSomeObjects()) {
905+
window.setTimeout(mapSomeObjectsAsync, 0);
906+
} else {
907+
if (thenDo) thenDo();
908+
}
909+
};
902910
if (!progressDo) {
903911
while (mapSomeObjects()); // do it synchronously
904912
if (thenDo) thenDo();
905913
} else {
906-
function mapSomeObjectsAsync() {
907-
if (mapSomeObjects()) {
908-
window.setTimeout(mapSomeObjectsAsync, 0);
909-
} else {
910-
if (thenDo) thenDo();
911-
}
912-
};
913914
window.setTimeout(mapSomeObjectsAsync, 0);
914915
}
915916
},

0 commit comments

Comments
 (0)