зеркало из https://github.com/mozilla/pluotsorbet.git
maintain static fields in runtime
This commit is contained in:
Родитель
c6f918d9e0
Коммит
e21bfc4ea2
|
@ -4,8 +4,9 @@
|
|||
'use strict';
|
||||
|
||||
function Runtime() {
|
||||
this.initialized = Object.create(null);
|
||||
this.pending = Object.create(null);
|
||||
this.initialized = {};
|
||||
this.pending = {};
|
||||
this.staticFields = {};
|
||||
}
|
||||
|
||||
Runtime.prototype.newPrimitiveArray = function(type, size) {
|
||||
|
|
4
vm.js
4
vm.js
|
@ -879,7 +879,7 @@ VM.execute = function(ctx) {
|
|||
field = resolve(op, idx);
|
||||
classInitCheck(field.classInfo, frame.ip-3);
|
||||
}
|
||||
var value = field.value;
|
||||
var value = ctx.runtime.staticFields[field.id];
|
||||
if (typeof value === "undefined") {
|
||||
value = util.defaultValue(field.signature);
|
||||
}
|
||||
|
@ -892,7 +892,7 @@ VM.execute = function(ctx) {
|
|||
field = resolve(op, idx);
|
||||
classInitCheck(field.classInfo, frame.ip-3);
|
||||
}
|
||||
field.value = stack.popType(field.signature);
|
||||
ctx.runtime.staticFields[field.id] = stack.popType(field.signature);
|
||||
break;
|
||||
case 0xbb: // new
|
||||
var idx = frame.read16();
|
||||
|
|
Загрузка…
Ссылка в новой задаче