2021-01-12 21:30:52 +00:00
|
|
|
/*
|
2022-02-09 16:15:55 +00:00
|
|
|
* Copyright (c) 2020-2022, the SerenityOS developers.
|
2021-01-12 21:30:52 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-01-12 21:30:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2021-06-24 21:32:06 +00:00
|
|
|
#ifndef AFLACLOADER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 AFLACLOADER_DEBUG
|
2021-06-24 21:32:06 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-09 16:15:55 +00:00
|
|
|
#ifndef AWAVLOADER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 AWAVLOADER_DEBUG
|
2022-02-09 16:15:55 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef BMP_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 BMP_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-09-21 17:22:16 +00:00
|
|
|
#ifndef BINDINGS_GENERATOR_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 BINDINGS_GENERATOR_DEBUG
|
2022-09-21 17:22:16 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef CACHE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 CACHE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CALLBACK_MACHINE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 CALLBACK_MACHINE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-03-04 17:50:23 +00:00
|
|
|
#ifndef CANVAS_RENDERING_CONTEXT_2D_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 CANVAS_RENDERING_CONTEXT_2D_DEBUG
|
2022-03-04 17:50:23 +00:00
|
|
|
#endif
|
|
|
|
|
2023-03-03 12:12:56 +00:00
|
|
|
#ifndef CMAKE_DEBUG
|
|
|
|
# cmakedefine01 CMAKE_DEBUG
|
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef COMPOSE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 COMPOSE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef COPY_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 COPY_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-02-06 13:48:46 +00:00
|
|
|
#ifndef CPP_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 CPP_DEBUG
|
2021-02-06 13:48:46 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-09 16:15:55 +00:00
|
|
|
#ifndef CPP_LANGUAGE_SERVER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 CPP_LANGUAGE_SERVER_DEBUG
|
2022-02-09 16:15:55 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef CRYPTO_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 CRYPTO_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-02-21 16:44:17 +00:00
|
|
|
#ifndef CSS_LOADER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 CSS_LOADER_DEBUG
|
2021-02-21 16:44:17 +00:00
|
|
|
#endif
|
|
|
|
|
2021-07-23 12:06:31 +00:00
|
|
|
#ifndef CSS_PARSER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 CSS_PARSER_DEBUG
|
2021-07-23 12:06:31 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef CSS_TOKENIZER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 CSS_TOKENIZER_DEBUG
|
2021-07-23 12:06:31 +00:00
|
|
|
#endif
|
|
|
|
|
2021-05-15 15:02:40 +00:00
|
|
|
#ifndef DDS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 DDS_DEBUG
|
2021-05-15 15:02:40 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef DHCPV4_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 DHCPV4_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-09 16:15:55 +00:00
|
|
|
#ifndef DHCPV4CLIENT_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 DHCPV4CLIENT_DEBUG
|
2022-02-09 16:15:55 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef DIFF_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 DIFF_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef DISASM_DUMP_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 DISASM_DUMP_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef DOUBLECLICK_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 DOUBLECLICK_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-01-09 22:35:42 +00:00
|
|
|
#ifndef DRAG_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 DRAG_DEBUG
|
2022-01-09 22:35:42 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef DWARF_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 DWARF_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef DYNAMIC_LOAD_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 DYNAMIC_LOAD_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef EDITOR_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 EDITOR_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ELF_IMAGE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 ELF_IMAGE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef EMOJI_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 EMOJI_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-05-17 21:32:59 +00:00
|
|
|
#ifndef ESCAPE_SEQUENCE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 ESCAPE_SEQUENCE_DEBUG
|
2021-05-17 21:32:59 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef EVENT_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 EVENT_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef FILE_CONTENT_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 FILE_CONTENT_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef FILL_PATH_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 FILL_PATH_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-05-17 21:32:59 +00:00
|
|
|
#ifndef FILE_WATCHER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 FILE_WATCHER_DEBUG
|
2021-05-17 21:32:59 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef GEMINI_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 GEMINI_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef GENERATE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 GENERATE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef GHASH_PROCESS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 GHASH_PROCESS_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef GIF_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 GIF_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-06 11:58:01 +00:00
|
|
|
#ifndef GL_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 GL_DEBUG
|
2021-01-06 11:58:01 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef GLOBAL_DTORS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 GLOBAL_DTORS_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-03-02 01:21:35 +00:00
|
|
|
#ifndef GPT_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 GPT_DEBUG
|
2022-03-02 01:21:35 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef HEAP_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 HEAP_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-05-20 12:27:58 +00:00
|
|
|
#ifndef HEARTS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 HEARTS_DEBUG
|
2021-05-20 12:27:58 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef HEX_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 HEX_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HIGHLIGHT_FOCUSED_FRAME_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 HIGHLIGHT_FOCUSED_FRAME_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef HTML_SCRIPT_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 HTML_SCRIPT_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-01-22 16:55:29 +00:00
|
|
|
#ifndef HTTPJOB_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 HTTPJOB_DEBUG
|
2022-01-22 16:55:29 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef HUNKS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 HUNKS_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ICO_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 ICO_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef IMAGE_DECODER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 IMAGE_DECODER_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef IMAGE_LOADER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 IMAGE_LOADER_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ITEM_RECTS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 ITEM_RECTS_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef JOB_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 JOB_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2023-02-18 21:09:16 +00:00
|
|
|
#ifndef JPEG_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 JPEG_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-06-07 13:17:37 +00:00
|
|
|
#ifndef JS_BYTECODE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 JS_BYTECODE_DEBUG
|
2021-06-07 13:17:37 +00:00
|
|
|
#endif
|
|
|
|
|
2022-01-18 17:47:11 +00:00
|
|
|
#ifndef JS_MODULE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 JS_MODULE_DEBUG
|
2022-01-18 17:47:11 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef KEYBOARD_SHORTCUTS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 KEYBOARD_SHORTCUTS_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-03-02 06:10:10 +00:00
|
|
|
#ifndef LANGUAGE_SERVER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 LANGUAGE_SERVER_DEBUG
|
2021-03-02 06:10:10 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef LEXER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 LEXER_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-06 13:17:42 +00:00
|
|
|
#ifndef LIBWEB_CSS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 LIBWEB_CSS_DEBUG
|
2022-02-06 13:17:42 +00:00
|
|
|
#endif
|
|
|
|
|
2021-02-20 18:03:13 +00:00
|
|
|
#ifndef LINE_EDITOR_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 LINE_EDITOR_DEBUG
|
2021-02-20 18:03:13 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef LOG_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 LOG_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef LOOKUPSERVER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 LOOKUPSERVER_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MALLOC_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 MALLOC_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MARKDOWN_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 MARKDOWN_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-06-05 20:06:55 +00:00
|
|
|
#ifndef MATROSKA_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 MATROSKA_DEBUG
|
2021-06-05 20:06:55 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MATROSKA_TRACE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 MATROSKA_TRACE_DEBUG
|
2021-06-05 20:06:55 +00:00
|
|
|
#endif
|
|
|
|
|
2022-03-02 00:42:06 +00:00
|
|
|
#ifndef MBR_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 MBR_DEBUG
|
2022-03-02 00:42:06 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef MEMORY_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 MEMORY_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MENU_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 MENU_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MOVE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 MOVE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-01-23 00:40:33 +00:00
|
|
|
#ifndef NETWORKJOB_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 NETWORKJOB_DEBUG
|
2022-01-23 00:40:33 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef NT_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 NT_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef OCCLUSIONS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 OCCLUSIONS_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2023-03-16 20:00:24 +00:00
|
|
|
#ifndef OPENTYPE_GPOS_DEBUG
|
|
|
|
# cmakedefine01 OPENTYPE_GPOS_DEBUG
|
|
|
|
#endif
|
|
|
|
|
2022-03-24 20:06:19 +00:00
|
|
|
#ifndef HTML_PARSER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 HTML_PARSER_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef PATH_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 PATH_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-05-08 21:57:49 +00:00
|
|
|
#ifndef PDF_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 PDF_DEBUG
|
2021-05-08 21:57:49 +00:00
|
|
|
#endif
|
|
|
|
|
2022-10-29 23:16:14 +00:00
|
|
|
#ifndef PLAYBACK_MANAGER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 PLAYBACK_MANAGER_DEBUG
|
2022-10-29 23:16:14 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef PNG_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 PNG_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef PORTABLE_IMAGE_LOADER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 PORTABLE_IMAGE_LOADER_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
LibJS: Add initial support for Promises
Almost a year after first working on this, it's finally done: an
implementation of Promises for LibJS! :^)
The core functionality is working and closely following the spec [1].
I mostly took the pseudo code and transformed it into C++ - if you read
and understand it, you will know how the spec implements Promises; and
if you read the spec first, the code will look very familiar.
Implemented functions are:
- Promise() constructor
- Promise.prototype.then()
- Promise.prototype.catch()
- Promise.prototype.finally()
- Promise.resolve()
- Promise.reject()
For the tests I added a new function to test-js's global object,
runQueuedPromiseJobs(), which calls vm.run_queued_promise_jobs().
By design, queued jobs normally only run after the script was fully
executed, making it improssible to test handlers in individual test()
calls by default [2].
Subsequent commits include integrations into LibWeb and js(1) -
pretty-printing, running queued promise jobs when necessary.
This has an unusual amount of dbgln() statements, all hidden behind the
PROMISE_DEBUG flag - I'm leaving them in for now as they've been very
useful while debugging this, things can get quite complex with so many
asynchronously executed functions.
I've not extensively explored use of these APIs for promise-based
functionality in LibWeb (fetch(), Notification.requestPermission()
etc.), but we'll get there in due time.
[1]: https://tc39.es/ecma262/#sec-promise-objects
[2]: https://tc39.es/ecma262/#sec-jobs-and-job-queues
2021-04-01 20:13:29 +00:00
|
|
|
#ifndef PROMISE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 PROMISE_DEBUG
|
LibJS: Add initial support for Promises
Almost a year after first working on this, it's finally done: an
implementation of Promises for LibJS! :^)
The core functionality is working and closely following the spec [1].
I mostly took the pseudo code and transformed it into C++ - if you read
and understand it, you will know how the spec implements Promises; and
if you read the spec first, the code will look very familiar.
Implemented functions are:
- Promise() constructor
- Promise.prototype.then()
- Promise.prototype.catch()
- Promise.prototype.finally()
- Promise.resolve()
- Promise.reject()
For the tests I added a new function to test-js's global object,
runQueuedPromiseJobs(), which calls vm.run_queued_promise_jobs().
By design, queued jobs normally only run after the script was fully
executed, making it improssible to test handlers in individual test()
calls by default [2].
Subsequent commits include integrations into LibWeb and js(1) -
pretty-printing, running queued promise jobs when necessary.
This has an unusual amount of dbgln() statements, all hidden behind the
PROMISE_DEBUG flag - I'm leaving them in for now as they've been very
useful while debugging this, things can get quite complex with so many
asynchronously executed functions.
I've not extensively explored use of these APIs for promise-based
functionality in LibWeb (fetch(), Notification.requestPermission()
etc.), but we'll get there in due time.
[1]: https://tc39.es/ecma262/#sec-promise-objects
[2]: https://tc39.es/ecma262/#sec-jobs-and-job-queues
2021-04-01 20:13:29 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef PTHREAD_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 PTHREAD_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef REACHABLE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 REACHABLE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef REGEX_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 REGEX_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-01-22 01:04:58 +00:00
|
|
|
#ifndef REQUESTSERVER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 REQUESTSERVER_DEBUG
|
2022-01-22 01:04:58 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef RESIZE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 RESIZE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef RESOURCE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 RESOURCE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-02-14 11:20:42 +00:00
|
|
|
#ifndef RSA_PARSE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 RSA_PARSE_DEBUG
|
2021-02-14 11:20:42 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef SERVICE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SERVICE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SH_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SH_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SH_LANGUAGE_SERVER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SH_LANGUAGE_SERVER_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-01-23 22:31:51 +00:00
|
|
|
#ifndef SHARED_QUEUE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SHARED_QUEUE_DEBUG
|
2022-01-23 22:31:51 +00:00
|
|
|
#endif
|
|
|
|
|
2021-04-26 01:28:37 +00:00
|
|
|
#ifndef SHELL_JOB_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SHELL_JOB_DEBUG
|
2021-04-26 01:28:37 +00:00
|
|
|
#endif
|
|
|
|
|
2023-02-11 14:29:15 +00:00
|
|
|
#ifndef SHELL_POSIX_PARSER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SHELL_POSIX_PARSER_DEBUG
|
2023-02-11 14:29:15 +00:00
|
|
|
#endif
|
|
|
|
|
2021-05-16 02:12:22 +00:00
|
|
|
#ifndef SOLITAIRE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SOLITAIRE_DEBUG
|
2021-05-16 02:12:22 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef SPAM_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SPAM_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-04-18 21:34:17 +00:00
|
|
|
#ifndef SQL_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SQL_DEBUG
|
2021-04-18 21:34:17 +00:00
|
|
|
#endif
|
|
|
|
|
2021-06-29 01:15:17 +00:00
|
|
|
#ifndef SQLSERVER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SQLSERVER_DEBUG
|
2021-06-29 01:15:17 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef SYNTAX_HIGHLIGHTING_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SYNTAX_HIGHLIGHTING_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-02-11 21:43:18 +00:00
|
|
|
#ifndef SYSCALL_1_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SYSCALL_1_DEBUG
|
2021-02-11 21:43:18 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef SYSTEM_MENU_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SYSTEM_MENU_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef SYSTEMSERVER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 SYSTEMSERVER_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef TERMCAP_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 TERMCAP_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef TERMINAL_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 TERMINAL_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef TEXTEDITOR_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 TEXTEDITOR_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-09-28 20:04:00 +00:00
|
|
|
#ifndef TIME_ZONE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 TIME_ZONE_DEBUG
|
2022-09-28 20:04:00 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef TLS_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 TLS_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-09 19:42:56 +00:00
|
|
|
#ifndef TLS_SSL_KEYLOG_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 TLS_SSL_KEYLOG_DEBUG
|
2022-02-09 19:42:56 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef TOKENIZER_TRACE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 TOKENIZER_TRACE_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef UCI_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 UCI_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef UPDATE_COALESCING_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 UPDATE_COALESCING_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2021-05-25 20:13:15 +00:00
|
|
|
#ifndef URL_PARSER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 URL_PARSER_DEBUG
|
2021-05-25 20:13:15 +00:00
|
|
|
#endif
|
|
|
|
|
2022-04-12 16:25:41 +00:00
|
|
|
#ifndef UTF8_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 UTF8_DEBUG
|
2022-04-12 16:25:41 +00:00
|
|
|
#endif
|
|
|
|
|
2023-04-04 21:44:43 +00:00
|
|
|
#ifndef WASI_DEBUG
|
|
|
|
# cmakedefine01 WASI_DEBUG
|
|
|
|
#endif
|
|
|
|
|
2021-04-26 08:18:13 +00:00
|
|
|
#ifndef WASM_BINPARSER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WASM_BINPARSER_DEBUG
|
2021-05-17 21:32:59 +00:00
|
|
|
#endif
|
2021-05-08 18:37:43 +00:00
|
|
|
|
2021-05-17 21:32:59 +00:00
|
|
|
#ifndef WASM_TRACE_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WASM_TRACE_DEBUG
|
2021-04-26 08:18:13 +00:00
|
|
|
#endif
|
|
|
|
|
2021-10-31 22:06:35 +00:00
|
|
|
#ifndef WASM_VALIDATOR_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WASM_VALIDATOR_DEBUG
|
2021-10-31 22:06:35 +00:00
|
|
|
#endif
|
|
|
|
|
2022-10-12 10:14:59 +00:00
|
|
|
#ifndef WEBDRIVER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WEBDRIVER_DEBUG
|
2022-10-12 10:14:59 +00:00
|
|
|
#endif
|
|
|
|
|
2022-06-04 03:27:48 +00:00
|
|
|
#ifndef WEBGL_CONTEXT_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WEBGL_CONTEXT_DEBUG
|
2022-06-04 03:27:48 +00:00
|
|
|
#endif
|
|
|
|
|
2021-05-30 14:42:03 +00:00
|
|
|
#ifndef WEBSERVER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WEBSERVER_DEBUG
|
2021-05-30 14:42:03 +00:00
|
|
|
#endif
|
|
|
|
|
2022-10-23 21:15:12 +00:00
|
|
|
#ifndef WEB_FETCH_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WEB_FETCH_DEBUG
|
2022-10-23 21:15:12 +00:00
|
|
|
#endif
|
|
|
|
|
2022-02-17 12:31:09 +00:00
|
|
|
#ifndef WEB_WORKER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WEB_WORKER_DEBUG
|
2022-02-17 12:31:09 +00:00
|
|
|
#endif
|
|
|
|
|
2023-02-24 03:37:08 +00:00
|
|
|
#ifndef WEBP_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WEBP_DEBUG
|
2023-02-24 03:37:08 +00:00
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef WINDOWMANAGER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WINDOWMANAGER_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
2023-04-14 01:48:55 +00:00
|
|
|
#ifndef WORKER_THREAD_DEBUG
|
|
|
|
# cmakedefine01 WORKER_THREAD_DEBUG
|
|
|
|
#endif
|
|
|
|
|
2021-01-30 15:47:20 +00:00
|
|
|
#ifndef WSMESSAGELOOP_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WSMESSAGELOOP_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef WSSCREEN_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 WSSCREEN_DEBUG
|
2021-01-30 15:47:20 +00:00
|
|
|
#endif
|
2022-03-26 17:02:57 +00:00
|
|
|
|
|
|
|
#ifndef XML_PARSER_DEBUG
|
2023-02-28 11:28:51 +00:00
|
|
|
# cmakedefine01 XML_PARSER_DEBUG
|
2022-03-26 17:02:57 +00:00
|
|
|
#endif
|