From a37e1bf7036f06a4a14603ea447659052aa42882 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Mon, 30 Sep 2024 17:09:54 +0200 Subject: [PATCH] Compiler: better name for global js name --- compiler/bin-js_of_ocaml/build_fs.ml | 4 ++-- compiler/tests-full/fs.expected.js | 4 ++-- runtime/fs.js | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/compiler/bin-js_of_ocaml/build_fs.ml b/compiler/bin-js_of_ocaml/build_fs.ml index 3d20db9454..3465edd4f9 100644 --- a/compiler/bin-js_of_ocaml/build_fs.ml +++ b/compiler/bin-js_of_ocaml/build_fs.ml @@ -54,8 +54,8 @@ function jsoo_create_file_extern(name,content){ if(globalThis.jsoo_create_file) globalThis.jsoo_create_file(name,content); else { - if(!globalThis.caml_fs_tmp) globalThis.caml_fs_tmp = []; - globalThis.caml_fs_tmp.push({name:name,content:content}); + if(!globalThis.jsoo_fs_tmp) globalThis.jsoo_fs_tmp = []; + globalThis.jsoo_fs_tmp.push({name:name,content:content}); } return 0; } diff --git a/compiler/tests-full/fs.expected.js b/compiler/tests-full/fs.expected.js index 82bf5656ea..37a971ee91 100644 --- a/compiler/tests-full/fs.expected.js +++ b/compiler/tests-full/fs.expected.js @@ -19,8 +19,8 @@ if(c.jsoo_create_file) c.jsoo_create_file(a, b); else{ - if(! c.caml_fs_tmp) c.caml_fs_tmp = []; - c.caml_fs_tmp.push({name: a, content: b}); + if(! c.jsoo_fs_tmp) c.jsoo_fs_tmp = []; + c.jsoo_fs_tmp.push({name: a, content: b}); } return 0; } diff --git a/runtime/fs.js b/runtime/fs.js index 3f2e1bf6a6..55518acf85 100644 --- a/runtime/fs.js +++ b/runtime/fs.js @@ -300,8 +300,8 @@ function caml_ba_map_file_bytecode(argv, argn) { function jsoo_create_file_extern(name, content) { if (globalThis.jsoo_create_file) globalThis.jsoo_create_file(name, content); else { - if (!globalThis.caml_fs_tmp) globalThis.caml_fs_tmp = []; - globalThis.caml_fs_tmp.push({ name: name, content: content }); + if (!globalThis.jsoo_fs_tmp) globalThis.jsoo_fs_tmp = []; + globalThis.jsoo_fs_tmp.push({ name: name, content: content }); } return 0; } @@ -309,14 +309,14 @@ function jsoo_create_file_extern(name, content) { //Provides: caml_fs_init //Requires: jsoo_create_file function caml_fs_init() { - var tmp = globalThis.caml_fs_tmp; + var tmp = globalThis.jsoo_fs_tmp; if (tmp) { for (var i = 0; i < tmp.length; i++) { jsoo_create_file(tmp[i].name, tmp[i].content); } } globalThis.jsoo_create_file = jsoo_create_file; - globalThis.caml_fs_tmp = []; + globalThis.jsoo_fs_tmp = []; return 0; }