@mikrojs/native 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mikrojs/native",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Mikro.js C++ runtime library and Node.js native addon",
5
5
  "keywords": [
6
6
  "esp32",
@@ -78,7 +78,7 @@
78
78
  "cmake-js": "^8.0.0",
79
79
  "node-addon-api": "^8.7.0",
80
80
  "node-gyp-build": "^4.8.4",
81
- "@mikrojs/quickjs": "0.6.0"
81
+ "@mikrojs/quickjs": "0.6.1"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@swc/core": "^1.15.30",
package/src/mik_repl.cpp CHANGED
@@ -104,7 +104,10 @@ bool mik__proto_read_exact(MIKReplTransport* transport, void* buf, size_t n) {
104
104
  return false;
105
105
  }
106
106
  }
107
- if (repl_ctx) {
107
+ /* Microtasks are deferred user JS: settling them re-enters .then
108
+ * handlers that can write to the transport (console.log → MSG_LOG)
109
+ * or touch the filesystem mid-deploy. Gate on pause too. */
110
+ if (repl_ctx && !repl_paused) {
108
111
  mik__execute_jobs(repl_ctx);
109
112
  }
110
113
  /* A pumped job (e.g. the test runtime's __testFileDone) may
@@ -1109,12 +1112,14 @@ void MIK_ProtocolServeLoop(void) {
1109
1112
  }
1110
1113
  }
1111
1114
 
1112
- /* Pump event loop between commands (skip timers/callbacks when paused,
1113
- * but always run microtasks so promises can settle) */
1115
+ /* Pump event loop between commands. Skip both timers/callbacks AND
1116
+ * microtasks when paused draining microtasks runs user .then
1117
+ * handlers, which can interleave MSG_LOG output with deploy traffic
1118
+ * or race the staged-file swap. */
1114
1119
  if (repl_mik_rt && !repl_paused) {
1115
1120
  MIK_Loop(repl_mik_rt);
1116
1121
  }
1117
- if (ctx) {
1122
+ if (ctx && !repl_paused) {
1118
1123
  mik__execute_jobs(ctx);
1119
1124
  }
1120
1125
  }