зеркало из https://github.com/mozilla/pluotsorbet.git
Merge branch 'master' of https://github.com/andreasgal/j2me.js into introduce_native_create
Conflicts: native.js
This commit is contained in:
Коммит
118a04612d
50
context.js
50
context.js
|
@ -141,38 +141,36 @@ Context.prototype.execute = function() {
|
|||
Context.prototype.start = function() {
|
||||
var ctx = this;
|
||||
|
||||
window.setZeroTimeout(function() {
|
||||
Instrument.callResumeHooks(ctx.current());
|
||||
try {
|
||||
VM.execute(ctx);
|
||||
} catch (e) {
|
||||
switch (e) {
|
||||
case VM.Yield:
|
||||
break;
|
||||
case VM.Pause:
|
||||
Instrument.callPauseHooks(ctx.current());
|
||||
return;
|
||||
default:
|
||||
console.info(e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
Instrument.callPauseHooks(ctx.current());
|
||||
|
||||
// If there's one frame left, we're back to
|
||||
// the method that created the thread and
|
||||
// we're done.
|
||||
if (ctx.frames.length === 1) {
|
||||
ctx.kill();
|
||||
Instrument.callResumeHooks(ctx.current());
|
||||
try {
|
||||
VM.execute(ctx);
|
||||
} catch (e) {
|
||||
switch (e) {
|
||||
case VM.Yield:
|
||||
break;
|
||||
case VM.Pause:
|
||||
Instrument.callPauseHooks(ctx.current());
|
||||
return;
|
||||
default:
|
||||
console.info(e);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
Instrument.callPauseHooks(ctx.current());
|
||||
|
||||
ctx.start();
|
||||
});
|
||||
// If there's one frame left, we're back to
|
||||
// the method that created the thread and
|
||||
// we're done.
|
||||
if (ctx.frames.length === 1) {
|
||||
ctx.kill();
|
||||
return;
|
||||
}
|
||||
|
||||
ctx.resume();
|
||||
}
|
||||
|
||||
Context.prototype.resume = function() {
|
||||
this.start();
|
||||
window.setZeroTimeout(this.start.bind(this));
|
||||
}
|
||||
|
||||
Context.prototype.block = function(obj, queue, lockLevel) {
|
||||
|
|
|
@ -486,7 +486,7 @@ Native.create("java/lang/Thread.start0.()V", function(ctx) {
|
|||
});
|
||||
|
||||
ctx.frames.push(new Frame(syntheticMethod, [ this ], 0));
|
||||
ctx.start();
|
||||
ctx.resume();
|
||||
});
|
||||
|
||||
Native.create("java/lang/Thread.internalExit.()V", function(ctx) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче