Skip to content

Commit e0d6155

Browse files
committed
release 1.3.1
1 parent e0952f8 commit e0d6155

File tree

6 files changed

+44
-20
lines changed

6 files changed

+44
-20
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ There's a gazillion exciting things to do :)
127127

128128
Changelog
129129
---------
130+
2025-03-29: 1.3.1 add 'w', 'h', 'embedded' canvas options, minor fixes
130131
2025-03-28: 1.3.0 add OpenGL support, canvas is optional, fix socket plugin bug
131132
2025-02-19: 1.2.4 fix isAssociation for JS Bridge, optimize loading image with many objects
132133
2024-09-28: 1.2.3 fix primitiveInputSemaphore, fix iOS keyboard

dist/squeak_bundle.js

+31-10
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@
116116
Object.extend(Squeak,
117117
"version", {
118118
// system attributes
119-
vmVersion: "SqueakJS 1.3.0",
120-
vmDate: "2025-03-28", // Maybe replace at build time?
119+
vmVersion: "SqueakJS 1.3.1",
120+
vmDate: "2025-03-29", // Maybe replace at build time?
121121
vmBuild: "unknown", // this too?
122122
vmPath: "unknown", // Replace at runtime
123123
vmFile: "vm.js",
@@ -2907,8 +2907,7 @@
29072907
},
29082908
hackImage: function() {
29092909
// hack methods to make work / speed up
2910-
var opts = typeof location === 'object' ? location.hash : "",
2911-
sista = this.method.methodSignFlag();
2910+
var sista = this.method.methodSignFlag();
29122911
[
29132912
// Etoys fallback for missing translation files is hugely inefficient.
29142913
// This speeds up opening a viewer by 10x (!)
@@ -2918,7 +2917,9 @@
29182917
// 64 bit Squeak does not flush word size on snapshot
29192918
{method: "SmalltalkImage>>wordSize", literal: {index: 1, old: 8, hack: 4}, enabled: true},
29202919
// Squeak 5.3 disable wizard by replacing #open send with pop
2921-
{method: "ReleaseBuilder class>>prepareEnvironment", bytecode: {pc: 28, old: 0xD8, hack: 0x87}, enabled: opts.includes("wizard=false")},
2920+
{method: "ReleaseBuilder class>>prepareEnvironment", bytecode: {pc: 28, old: 0xD8, hack: 0x87}, enabled: !sista & this.options.wizard===false},
2921+
// Squeak 6.0 disable wizard by replacing #open send with pop
2922+
{method: "ReleaseBuilder class>>prepareEnvironment", bytecode: {closure: 9, pc: 5, old: 0x81, hack: 0xD8}, enabled: sista & this.options.wizard===false},
29222923
// Squeak source file should use UTF8 not MacRoman (both V3 and Sista)
29232924
{method: "Latin1Environment class>>systemConverterClass", bytecode: {pc: 53, old: 0x45, hack: 0x49}, enabled: !this.image.isSpur},
29242925
{method: "Latin1Environment class>>systemConverterClass", bytecode: {pc: 38, old: 0x16, hack: 0x13}, enabled: this.image.isSpur && sista},
@@ -2931,6 +2932,7 @@
29312932
byte = each.bytecode,
29322933
lit = each.literal,
29332934
hacked = true;
2935+
if (byte && byte.closure) m = m.pointers[byte.closure];
29342936
if (prim) m.pointers[0] |= prim;
29352937
else if (byte && m.bytes[byte.pc] === byte.old) m.bytes[byte.pc] = byte.hack;
29362938
else if (byte && m.bytes[byte.pc] === byte.hack) hacked = false; // already there
@@ -20580,6 +20582,7 @@
2058020582
canvas.classList.add("b3daccel");
2058120583
canvas.width = w;
2058220584
canvas.height = h;
20585+
canvas.style.position = "absolute";
2058320586
canvas.style.backgroundColor = "transparent";
2058420587
canvas.style.pointerEvents = "none";
2058520588
canvas.style.cursor = "normal";
@@ -59619,6 +59622,8 @@
5961959622
display.fullscreen = fullscreen;
5962059623
var fullwindow = fullscreen || options.fullscreen;
5962159624
box.style.background = fullwindow ? 'black' : '';
59625+
box.style.border = fullwindow ? 'none' : '';
59626+
box.style.borderRadius = fullwindow ? '0px' : '';
5962259627
setTimeout(onresize, 0);
5962359628
}
5962459629

@@ -59674,10 +59679,12 @@
5967459679
display.cursorCanvas.style.top = (evtY + canvas.offsetTop + display.cursorOffsetY) + "px";
5967559680
}
5967659681
var x = (evtX * canvas.width / canvas.offsetWidth) | 0,
59677-
y = (evtY * canvas.height / canvas.offsetHeight) | 0;
59682+
y = (evtY * canvas.height / canvas.offsetHeight) | 0,
59683+
w = display.width || canvas.width,
59684+
h = display.height || canvas.height;
5967859685
// clamp to display size
59679-
display.mouseX = Math.max(0, Math.min(display.width, x));
59680-
display.mouseY = Math.max(0, Math.min(display.height, y));
59686+
display.mouseX = Math.max(0, Math.min(w, x));
59687+
display.mouseY = Math.max(0, Math.min(h, y));
5968159688
}
5968259689

5968359690
function recordMouseEvent(what, evt, canvas, display, options) {
@@ -59834,6 +59841,8 @@
5983459841
if (options.fullscreen) {
5983559842
document.body.style.margin = 0;
5983659843
document.body.style.backgroundColor = 'black';
59844+
canvas.style.border = 'none';
59845+
canvas.style.borderRadius = '0px';
5983759846
document.ontouchmove = function(evt) { evt.preventDefault(); };
5983859847
}
5983959848
var display = {
@@ -60560,8 +60569,10 @@
6056060569
h - paddingY
6056160570
);
6056260571
}
60563-
onresize();
60564-
window.onresize = onresize;
60572+
if (!options.embedded) {
60573+
onresize();
60574+
window.onresize = onresize;
60575+
}
6056560576

6056660577
return display;
6056760578
}
@@ -60676,6 +60687,11 @@
6067660687
Squeak.dirCreate(root, true);
6067760688
if (!/\/$/.test(root)) root += "/";
6067860689
options.root = root;
60690+
if (options.w) options.fixedWidth = options.w;
60691+
if (options.h) options.fixedHeight = options.h;
60692+
if (options.fixedWidth && !options.fixedHeight) options.fixedHeight = options.fixedWidth * 3 / 4 | 0;
60693+
if (options.fixedHeight && !options.fixedWidth) options.fixedWidth = options.fixedHeight * 4 / 3 | 0;
60694+
if (options.fixedWidth && options.fixedHeight) options.fullscreen = true;
6067960695
SqueakJS.options = options;
6068060696
}
6068160697

@@ -60840,6 +60856,11 @@
6084060856
}
6084160857
// we need to fetch all files first, then run the image
6084260858
processOptions(options);
60859+
if (imageUrl && imageUrl.endsWith(".zip")) {
60860+
options.zip = imageUrl.match(/[^\/]*$/)[0];
60861+
options.url = imageUrl.replace(/[^\/]*$/, "");
60862+
imageUrl = null;
60863+
}
6084360864
if (!imageUrl && options.image) imageUrl = options.image;
6084460865
var baseUrl = options.url || "";
6084560866
if (!baseUrl && imageUrl && imageUrl.replace(/[^\/]*$/, "")) {

dist/squeak_headless_bundle.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ if (!Function.prototype.subclass) {
113113
Object.extend(Squeak,
114114
"version", {
115115
// system attributes
116-
vmVersion: "SqueakJS 1.3.0",
117-
vmDate: "2025-03-28", // Maybe replace at build time?
116+
vmVersion: "SqueakJS 1.3.1",
117+
vmDate: "2025-03-29", // Maybe replace at build time?
118118
vmBuild: "unknown", // this too?
119119
vmPath: "unknown", // Replace at runtime
120120
vmFile: "vm.js",
@@ -2904,8 +2904,7 @@ Object.subclass('Squeak.Interpreter',
29042904
},
29052905
hackImage: function() {
29062906
// hack methods to make work / speed up
2907-
var opts = typeof location === 'object' ? location.hash : "",
2908-
sista = this.method.methodSignFlag();
2907+
var sista = this.method.methodSignFlag();
29092908
[
29102909
// Etoys fallback for missing translation files is hugely inefficient.
29112910
// This speeds up opening a viewer by 10x (!)
@@ -2915,7 +2914,9 @@ Object.subclass('Squeak.Interpreter',
29152914
// 64 bit Squeak does not flush word size on snapshot
29162915
{method: "SmalltalkImage>>wordSize", literal: {index: 1, old: 8, hack: 4}, enabled: true},
29172916
// Squeak 5.3 disable wizard by replacing #open send with pop
2918-
{method: "ReleaseBuilder class>>prepareEnvironment", bytecode: {pc: 28, old: 0xD8, hack: 0x87}, enabled: opts.includes("wizard=false")},
2917+
{method: "ReleaseBuilder class>>prepareEnvironment", bytecode: {pc: 28, old: 0xD8, hack: 0x87}, enabled: !sista & this.options.wizard===false},
2918+
// Squeak 6.0 disable wizard by replacing #open send with pop
2919+
{method: "ReleaseBuilder class>>prepareEnvironment", bytecode: {closure: 9, pc: 5, old: 0x81, hack: 0xD8}, enabled: sista & this.options.wizard===false},
29192920
// Squeak source file should use UTF8 not MacRoman (both V3 and Sista)
29202921
{method: "Latin1Environment class>>systemConverterClass", bytecode: {pc: 53, old: 0x45, hack: 0x49}, enabled: !this.image.isSpur},
29212922
{method: "Latin1Environment class>>systemConverterClass", bytecode: {pc: 38, old: 0x16, hack: 0x13}, enabled: this.image.isSpur && sista},
@@ -2928,6 +2929,7 @@ Object.subclass('Squeak.Interpreter',
29282929
byte = each.bytecode,
29292930
lit = each.literal,
29302931
hacked = true;
2932+
if (byte && byte.closure) m = m.pointers[byte.closure];
29312933
if (prim) m.pointers[0] |= prim;
29322934
else if (byte && m.bytes[byte.pc] === byte.old) m.bytes[byte.pc] = byte.hack;
29332935
else if (byte && m.bytes[byte.pc] === byte.hack) hacked = false; // already there

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@codefrau/squeakjs",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Virtual Machine for Squeak Smalltalk and derivatives",
55
"author": "Vanessa Freudenberg <[email protected]> (https://twitter.com/codefrau)",
66
"repository": "https://github.com/codefrau/SqueakJS",

vm.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
Object.extend(Squeak,
2525
"version", {
2626
// system attributes
27-
vmVersion: "SqueakJS 1.3.0",
28-
vmDate: "2025-03-28", // Maybe replace at build time?
27+
vmVersion: "SqueakJS 1.3.1",
28+
vmDate: "2025-03-29", // Maybe replace at build time?
2929
vmBuild: "unknown", // this too?
3030
vmPath: "unknown", // Replace at runtime
3131
vmFile: "vm.js",

0 commit comments

Comments
 (0)