mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
fix: setTimeout issue in webworkers
This commit is contained in:
parent
38c4498f3a
commit
d838e4d397
@ -1,6 +1,8 @@
|
||||
"use strict";
|
||||
|
||||
const immediate = require("../setImmediate");
|
||||
const setImmediate = immediate.___setImmediate;
|
||||
const clearImmediate = immediate.___clearImmediate;
|
||||
const StringWriter = require("./StringWriter");
|
||||
|
||||
/**
|
||||
@ -19,7 +21,7 @@ BufferedWriter.prototype = Object.assign(
|
||||
{
|
||||
scheduleFlush() {
|
||||
if (!this._scheduled) {
|
||||
this._scheduled = immediate.___setImmediate(flush.bind(0, this));
|
||||
this._scheduled = setImmediate(flush.bind(0, this));
|
||||
}
|
||||
},
|
||||
|
||||
@ -43,7 +45,7 @@ function flush(writer) {
|
||||
}
|
||||
}
|
||||
|
||||
immediate.___clearImmediate(writer._scheduled);
|
||||
clearImmediate(writer._scheduled);
|
||||
writer._scheduled = null;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user