Skip to content

Commit

Permalink
repl: Update to new emscripten APIs
Browse files Browse the repository at this point in the history
Fixes #10.
  • Loading branch information
alimpfard committed Jul 15, 2024
1 parent 2af17a6 commit 6c5363b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions repl/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ async function createREPL(elements) {

try {
const dateTimeFormat = new Intl.DateTimeFormat();
timeZone = Module.allocateUTF8(dateTimeFormat.resolvedOptions().timeZone);
timeZone = Module.stringToNewUTF8(
dateTimeFormat.resolvedOptions().timeZone
);
} catch {
timeZone = Module.allocateUTF8("UTC");
timeZone = Module.stringToNewUTF8("UTC");
}

if (Module._initialize_repl(timeZone) !== 0)
Expand Down Expand Up @@ -94,7 +96,7 @@ async function createREPL(elements) {
return node;
},
execute(text) {
const encodedText = Module.allocateUTF8(text);
const encodedText = Module.stringToNewUTF8(text);
let oldRepl = globalDisplayToUser.repl;
try {
globalDisplayToUser.repl = repl.private.outputs;
Expand Down

0 comments on commit 6c5363b

Please sign in to comment.