aboutsummaryrefslogtreecommitdiff
path: root/src/js_lexer_tables.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/js_lexer_tables.zig')
-rw-r--r--src/js_lexer_tables.zig6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/js_lexer_tables.zig b/src/js_lexer_tables.zig
index 7a1bf705e..ef4b13e8c 100644
--- a/src/js_lexer_tables.zig
+++ b/src/js_lexer_tables.zig
@@ -536,9 +536,15 @@ pub const TypescriptStmtKeyword = enum {
pub const JSXEntityMap = std.StringHashMap(CodePoint);
pub var jsxEntity: JSXEntityMap = undefined;
+var has_loaded_jsx_map = false;
// There's probably a way to move this to comptime
pub fn initJSXEntityMap() !void {
+ if (has_loaded_jsx_map) {
+ return;
+ }
+
+ has_loaded_jsx_map = true;
jsxEntity = JSXEntityMap.init(alloc.dynamic);
// return jsxEntity;
jsxEntity.ensureCapacity(255) catch unreachable;