kopia lustrzana https://github.com/micropython/micropython
webassembly/library: Fix formatting and style for Biome.
Signed-off-by: Damien George <damien@micropython.org>pull/13583/head
rodzic
26d6969fef
commit
c2cf58befc
|
@ -30,23 +30,33 @@ mergeInto(LibraryManager.library, {
|
|||
|
||||
mp_js_ticks_ms: () => Date.now() - MP_JS_EPOCH,
|
||||
|
||||
mp_js_hook: function() {
|
||||
mp_js_hook: () => {
|
||||
if (ENVIRONMENT_IS_NODE) {
|
||||
var mp_interrupt_char = Module.ccall('mp_hal_get_interrupt_char', 'number', ['number'], ['null']);
|
||||
var fs = require('fs');
|
||||
const mp_interrupt_char = Module.ccall(
|
||||
"mp_hal_get_interrupt_char",
|
||||
"number",
|
||||
["number"],
|
||||
["null"],
|
||||
);
|
||||
const fs = require("fs");
|
||||
|
||||
var buf = Buffer.alloc(1);
|
||||
const buf = Buffer.alloc(1);
|
||||
try {
|
||||
var n = fs.readSync(process.stdin.fd, buf, 0, 1);
|
||||
const n = fs.readSync(process.stdin.fd, buf, 0, 1);
|
||||
if (n > 0) {
|
||||
if (buf[0] == mp_interrupt_char) {
|
||||
Module.ccall('mp_sched_keyboard_interrupt', 'null', ['null'], ['null']);
|
||||
if (buf[0] === mp_interrupt_char) {
|
||||
Module.ccall(
|
||||
"mp_sched_keyboard_interrupt",
|
||||
"null",
|
||||
["null"],
|
||||
["null"],
|
||||
);
|
||||
} else {
|
||||
process.stdout.write(String.fromCharCode(buf[0]));
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (e.code === 'EAGAIN') {
|
||||
if (e.code === "EAGAIN") {
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue