|
116 | 116 | Object.extend(Squeak, |
117 | 117 | "version", { |
118 | 118 | // system attributes |
119 | | - vmVersion: "SqueakJS 1.2.0", |
120 | | - vmDate: "2024-03-25", // Maybe replace at build time? |
| 119 | + vmVersion: "SqueakJS 1.2.1", |
| 120 | + vmDate: "2024-05-27", // Maybe replace at build time? |
121 | 121 | vmBuild: "unknown", // or replace at runtime by last-modified? |
122 | 122 | vmPath: "unknown", // Replace at runtime |
123 | 123 | vmFile: "vm.js", |
|
3076 | 3076 |
|
3077 | 3077 | // Arithmetic Ops... + - < > <= >= = ~= * / @ lshift: lxor: land: lor: |
3078 | 3078 | case 0xB0: this.success = true; this.resultIsFloat = false; |
3079 | | - if(!this.pop2AndPushNumResult(this.stackIntOrFloat(1) + this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // PLUS + |
| 3079 | + if (!this.pop2AndPushNumResult(this.stackIntOrFloat(1) + this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // PLUS + |
3080 | 3080 | case 0xB1: this.success = true; this.resultIsFloat = false; |
3081 | | - if(!this.pop2AndPushNumResult(this.stackIntOrFloat(1) - this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // MINUS - |
| 3081 | + if (!this.pop2AndPushNumResult(this.stackIntOrFloat(1) - this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // MINUS - |
3082 | 3082 | case 0xB2: this.success = true; |
3083 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) < this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // LESS < |
| 3083 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) < this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // LESS < |
3084 | 3084 | case 0xB3: this.success = true; |
3085 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) > this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // GRTR > |
| 3085 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) > this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // GRTR > |
3086 | 3086 | case 0xB4: this.success = true; |
3087 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) <= this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // LEQ <= |
| 3087 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) <= this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // LEQ <= |
3088 | 3088 | case 0xB5: this.success = true; |
3089 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) >= this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // GEQ >= |
| 3089 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) >= this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // GEQ >= |
3090 | 3090 | case 0xB6: this.success = true; |
3091 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) === this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // EQU = |
| 3091 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) === this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // EQU = |
3092 | 3092 | case 0xB7: this.success = true; |
3093 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) !== this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // NEQ ~= |
| 3093 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) !== this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // NEQ ~= |
3094 | 3094 | case 0xB8: this.success = true; this.resultIsFloat = false; |
3095 | | - if(!this.pop2AndPushNumResult(this.stackIntOrFloat(1) * this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // TIMES * |
| 3095 | + if (!this.pop2AndPushNumResult(this.stackIntOrFloat(1) * this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // TIMES * |
3096 | 3096 | case 0xB9: this.success = true; |
3097 | | - if(!this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // Divide / |
| 3097 | + if (!this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // Divide / |
3098 | 3098 | case 0xBA: this.success = true; |
3099 | | - if(!this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // MOD \ |
| 3099 | + if (!this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // MOD \ |
3100 | 3100 | case 0xBB: this.success = true; |
3101 | | - if(!this.primHandler.primitiveMakePoint(1, true)) this.sendSpecial(b&0xF); return; // MakePt int@int |
| 3101 | + if (!this.primHandler.primitiveMakePoint(1, true)) this.sendSpecial(b&0xF); return; // MakePt int@int |
3102 | 3102 | case 0xBC: this.success = true; |
3103 | | - if(!this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // bitShift: |
| 3103 | + if (!this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // bitShift: |
3104 | 3104 | case 0xBD: this.success = true; |
3105 | | - if(!this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // Divide // |
| 3105 | + if (!this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // Divide // |
3106 | 3106 | case 0xBE: this.success = true; |
3107 | | - if(!this.pop2AndPushIntResult(this.stackInteger(1) & this.stackInteger(0))) this.sendSpecial(b&0xF); return; // bitAnd: |
| 3107 | + if (!this.pop2AndPushIntResult(this.stackInteger(1) & this.stackInteger(0))) this.sendSpecial(b&0xF); return; // bitAnd: |
3108 | 3108 | case 0xBF: this.success = true; |
3109 | | - if(!this.pop2AndPushIntResult(this.stackInteger(1) | this.stackInteger(0))) this.sendSpecial(b&0xF); return; // bitOr: |
| 3109 | + if (!this.pop2AndPushIntResult(this.stackInteger(1) | this.stackInteger(0))) this.sendSpecial(b&0xF); return; // bitOr: |
3110 | 3110 |
|
3111 | 3111 | // at:, at:put:, size, next, nextPut:, ... |
3112 | 3112 | case 0xC0: case 0xC1: case 0xC2: case 0xC3: case 0xC4: case 0xC5: case 0xC6: case 0xC7: |
|
3190 | 3190 |
|
3191 | 3191 | // Arithmetic Ops... + - < > <= >= = ~= * / @ lshift: lxor: land: lor: |
3192 | 3192 | case 0x60: this.success = true; this.resultIsFloat = false; |
3193 | | - if(!this.pop2AndPushNumResult(this.stackIntOrFloat(1) + this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // PLUS + |
| 3193 | + if (!this.pop2AndPushNumResult(this.stackIntOrFloat(1) + this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // PLUS + |
3194 | 3194 | case 0x61: this.success = true; this.resultIsFloat = false; |
3195 | | - if(!this.pop2AndPushNumResult(this.stackIntOrFloat(1) - this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // MINUS - |
| 3195 | + if (!this.pop2AndPushNumResult(this.stackIntOrFloat(1) - this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // MINUS - |
3196 | 3196 | case 0x62: this.success = true; |
3197 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) < this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // LESS < |
| 3197 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) < this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // LESS < |
3198 | 3198 | case 0x63: this.success = true; |
3199 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) > this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // GRTR > |
| 3199 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) > this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // GRTR > |
3200 | 3200 | case 0x64: this.success = true; |
3201 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) <= this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // LEQ <= |
| 3201 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) <= this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // LEQ <= |
3202 | 3202 | case 0x65: this.success = true; |
3203 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) >= this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // GEQ >= |
| 3203 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) >= this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // GEQ >= |
3204 | 3204 | case 0x66: this.success = true; |
3205 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) === this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // EQU = |
| 3205 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) === this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // EQU = |
3206 | 3206 | case 0x67: this.success = true; |
3207 | | - if(!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) !== this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // NEQ ~= |
| 3207 | + if (!this.pop2AndPushBoolResult(this.stackIntOrFloat(1) !== this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // NEQ ~= |
3208 | 3208 | case 0x68: this.success = true; this.resultIsFloat = false; |
3209 | | - if(!this.pop2AndPushNumResult(this.stackIntOrFloat(1) * this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // TIMES * |
| 3209 | + if (!this.pop2AndPushNumResult(this.stackIntOrFloat(1) * this.stackIntOrFloat(0))) this.sendSpecial(b&0xF); return; // TIMES * |
3210 | 3210 | case 0x69: this.success = true; |
3211 | | - if(!this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // Divide / |
| 3211 | + if (!this.pop2AndPushIntResult(this.quickDivide(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // Divide / |
3212 | 3212 | case 0x6A: this.success = true; |
3213 | | - if(!this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // MOD \ |
| 3213 | + if (!this.pop2AndPushIntResult(this.mod(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // MOD \ |
3214 | 3214 | case 0x6B: this.success = true; |
3215 | | - if(!this.primHandler.primitiveMakePoint(1, true)) this.sendSpecial(b&0xF); return; // MakePt int@int |
| 3215 | + if (!this.primHandler.primitiveMakePoint(1, true)) this.sendSpecial(b&0xF); return; // MakePt int@int |
3216 | 3216 | case 0x6C: this.success = true; |
3217 | | - if(!this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // bitShift: |
| 3217 | + if (!this.pop2AndPushIntResult(this.safeShift(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // bitShift: |
3218 | 3218 | case 0x6D: this.success = true; |
3219 | | - if(!this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // Divide // |
| 3219 | + if (!this.pop2AndPushIntResult(this.div(this.stackInteger(1),this.stackInteger(0)))) this.sendSpecial(b&0xF); return; // Divide // |
3220 | 3220 | case 0x6E: this.success = true; |
3221 | | - if(!this.pop2AndPushIntResult(this.stackInteger(1) & this.stackInteger(0))) this.sendSpecial(b&0xF); return; // bitAnd: |
| 3221 | + if (!this.pop2AndPushIntResult(this.stackInteger(1) & this.stackInteger(0))) this.sendSpecial(b&0xF); return; // bitAnd: |
3222 | 3222 | case 0x6F: this.success = true; |
3223 | | - if(!this.pop2AndPushIntResult(this.stackInteger(1) | this.stackInteger(0))) this.sendSpecial(b&0xF); return; // bitOr: |
| 3223 | + if (!this.pop2AndPushIntResult(this.stackInteger(1) | this.stackInteger(0))) this.sendSpecial(b&0xF); return; // bitOr: |
3224 | 3224 |
|
3225 | 3225 | // at:, at:put:, size, next, nextPut:, ... |
3226 | 3226 | case 0x70: case 0x71: case 0x72: case 0x73: case 0x74: case 0x75: case 0x76: case 0x77: |
|
3443 | 3443 | var sema = this.specialObjects[Squeak.splOb_TheLowSpaceSemaphore]; |
3444 | 3444 | if (!sema.isNil) this.primHandler.synchronousSignal(sema); |
3445 | 3445 | } |
3446 | | - // if(now >= nextPollTick) { |
| 3446 | + // if (now >= nextPollTick) { |
3447 | 3447 | // ioProcessEvents(); //sets interruptPending if interrupt key pressed |
3448 | 3448 | // nextPollTick= now + 500; } //msecs to wait before next call to ioProcessEvents" |
3449 | 3449 | if (this.interruptPending) { |
|
7025 | 7025 | var rcvr = this.vm.stackValue(1); |
7026 | 7026 | var sqArgCount = this.stackInteger(0); |
7027 | 7027 | var homeCtxt = rcvr; |
7028 | | - if(!this.vm.isContext(homeCtxt)) this.success = false; |
7029 | | - if(!this.success) return rcvr; |
| 7028 | + if (!this.vm.isContext(homeCtxt)) this.success = false; |
| 7029 | + if (!this.success) return rcvr; |
7030 | 7030 | if (typeof homeCtxt.pointers[Squeak.Context_method] === "number") |
7031 | 7031 | // ctxt is itself a block; get the context for its enclosing method |
7032 | 7032 | homeCtxt = homeCtxt.pointers[Squeak.BlockContext_home]; |
|
7617 | 7617 | this.vm.image.fullGC("snapshot"); // before cleanup so traversal works |
7618 | 7618 | var buffer = this.vm.image.writeToBuffer(); |
7619 | 7619 | // Write snapshot if files are supported |
7620 | | - if(Squeak.flushAllFiles) { |
| 7620 | + if (Squeak.flushAllFiles) { |
7621 | 7621 | Squeak.flushAllFiles(); // so there are no more writes pending |
7622 | 7622 | Squeak.filePut(this.vm.image.name, buffer); |
7623 | 7623 | } |
|
7626 | 7626 | }, |
7627 | 7627 | primitiveQuit: function(argCount) { |
7628 | 7628 | // Flush any files if files are supported |
7629 | | - if(Squeak.flushAllFiles) |
| 7629 | + if (Squeak.flushAllFiles) |
7630 | 7630 | Squeak.flushAllFiles(); |
7631 | 7631 | this.display.quitFlag = true; |
7632 | 7632 | this.vm.breakNow("quit"); |
|
40289 | 40289 | if (this.status == plugin.Socket_Connected || |
40290 | 40290 | this.status == plugin.Socket_OtherEndClosed || |
40291 | 40291 | this.status == plugin.Socket_WaitingForConnection) { |
40292 | | - if(this.webSocket) { |
| 40292 | + if (this.webSocket) { |
40293 | 40293 | this.webSocket.close(); |
40294 | 40294 | this.webSocket = null; |
40295 | 40295 | } |
|
0 commit comments