From 63027feabc052685a9360171c6eed83f46378215 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Thu, 4 Aug 2022 20:01:26 +0200 Subject: [PATCH] [mujs] small success window.alert('Thu'); --- src/document/document.cpp | 4 +- src/document/html/parser/general.c | 6 +- src/document/renderer.cpp | 6 +- src/ecmascript/mujs.cpp | 23 +- src/ecmascript/mujs/meson.build | 3 + src/ecmascript/mujs/window.cpp | 529 +++++++++++++++++++++++++++++ src/ecmascript/mujs/window.h | 10 + src/main/timer.cpp | 8 +- src/protocol/protocol.cpp | 2 +- src/viewer/action.cpp | 2 +- src/viewer/text/form.cpp | 8 +- src/viewer/text/link.cpp | 4 +- src/viewer/text/vs.cpp | 6 +- 13 files changed, 587 insertions(+), 24 deletions(-) create mode 100644 src/ecmascript/mujs/window.cpp create mode 100644 src/ecmascript/mujs/window.h diff --git a/src/document/document.cpp b/src/document/document.cpp index 7b2325a2..a932dfe7 100644 --- a/src/document/document.cpp +++ b/src/document/document.cpp @@ -278,7 +278,7 @@ reset_document(struct document *document) #ifdef CONFIG_CSS free_uri_list(&document->css_imports); #endif -#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) +#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) || defined(CONFIG_MUJS) free_string_list(&document->onload_snippets); free_uri_list(&document->ecmascript_imports); mem_free_set(&document->text, NULL); @@ -348,7 +348,7 @@ done_document(struct document *document) #ifdef CONFIG_CSS free_uri_list(&document->css_imports); #endif -#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) +#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) || defined(CONFIG_MUJS) free_string_list(&document->onload_snippets); free_uri_list(&document->ecmascript_imports); kill_timer(&document->timeout); diff --git a/src/document/html/parser/general.c b/src/document/html/parser/general.c index 05177604..eb95f68e 100644 --- a/src/document/html/parser/general.c +++ b/src/document/html/parser/general.c @@ -208,7 +208,7 @@ void html_script(struct html_context *html_context, char *a, char *html, char *eof, char **end) { -#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) +#if defined(CONFIG_ECMASCRIPT_SMJS) || defined(CONFIG_QUICKJS) || defined(CONFIG_MUJS) /* TODO: