JavaScriptTestRunner.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. /*
  2. * Copyright (c) 2020, Matthew Olsson <mattco@serenityos.org>
  3. * Copyright (c) 2020-2022, Linus Groh <linusg@serenityos.org>
  4. * Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
  5. * Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
  6. *
  7. * SPDX-License-Identifier: BSD-2-Clause
  8. */
  9. #pragma once
  10. #include <AK/ByteBuffer.h>
  11. #include <AK/JsonObject.h>
  12. #include <AK/JsonValue.h>
  13. #include <AK/LexicalPath.h>
  14. #include <AK/QuickSort.h>
  15. #include <AK/Result.h>
  16. #include <AK/Tuple.h>
  17. #include <LibCore/DirIterator.h>
  18. #include <LibCore/File.h>
  19. #include <LibCore/Stream.h>
  20. #include <LibJS/Bytecode/Interpreter.h>
  21. #include <LibJS/Interpreter.h>
  22. #include <LibJS/Lexer.h>
  23. #include <LibJS/Parser.h>
  24. #include <LibJS/Runtime/Array.h>
  25. #include <LibJS/Runtime/GlobalObject.h>
  26. #include <LibJS/Runtime/JSONObject.h>
  27. #include <LibJS/Runtime/TypedArray.h>
  28. #include <LibJS/Runtime/WeakMap.h>
  29. #include <LibJS/Runtime/WeakSet.h>
  30. #include <LibJS/Script.h>
  31. #include <LibJS/SourceTextModule.h>
  32. #include <LibTest/Results.h>
  33. #include <LibTest/TestRunner.h>
  34. #include <fcntl.h>
  35. #include <sys/time.h>
  36. #include <unistd.h>
  37. #ifdef AK_OS_SERENITY
  38. # include <serenity.h>
  39. #endif
  40. #define STRCAT(x, y) __STRCAT(x, y)
  41. #define STRSTRCAT(x, y) __STRSTRCAT(x, y)
  42. #define __STRCAT(x, y) x #y
  43. #define __STRSTRCAT(x, y) x y
  44. // Note: This is a little weird, so here's an explanation:
  45. // If the vararg isn't given, the tuple initializer will simply expand to `fn, ::Test::JS::__testjs_last<1>()`
  46. // and if it _is_ given (say as `A`), the tuple initializer will expand to `fn, ::Test::JS::__testjs_last<1, A>()`, which will end up being evaluated as `A`
  47. // and if multiple args are given, the static_assert will be sad.
  48. #define __TESTJS_REGISTER_GLOBAL_FUNCTION(name, fn, ...) \
  49. struct __TestJS_register_##fn { \
  50. static_assert( \
  51. ::Test::JS::__testjs_count(__VA_ARGS__) <= 1, \
  52. STRCAT(STRSTRCAT(STRCAT("Expected at most three arguments to TESTJS_GLOBAL_FUNCTION at line", __LINE__), ", in file "), __FILE__)); \
  53. __TestJS_register_##fn() noexcept \
  54. { \
  55. ::Test::JS::s_exposed_global_functions.set( \
  56. name, \
  57. { fn, ::Test::JS::__testjs_last<1, ##__VA_ARGS__>() }); \
  58. } \
  59. } __testjs_register_##fn {};
  60. #define TESTJS_GLOBAL_FUNCTION(function, exposed_name, ...) \
  61. JS_DECLARE_NATIVE_FUNCTION(function); \
  62. __TESTJS_REGISTER_GLOBAL_FUNCTION(#exposed_name, function, ##__VA_ARGS__); \
  63. JS_DEFINE_NATIVE_FUNCTION(function)
  64. #define TESTJS_MAIN_HOOK() \
  65. struct __TestJS_main_hook { \
  66. __TestJS_main_hook() \
  67. { \
  68. ::Test::JS::g_main_hook = hook; \
  69. } \
  70. static void hook(); \
  71. } __testjs_common_register_##name {}; \
  72. void __TestJS_main_hook::hook()
  73. #define TESTJS_PROGRAM_FLAG(flag, help_string, long_name, short_name) \
  74. bool flag { false }; \
  75. struct __TestJS_flag_hook_##flag { \
  76. __TestJS_flag_hook_##flag() \
  77. { \
  78. ::Test::JS::g_extra_args.set(&(flag), { help_string, long_name, short_name }); \
  79. }; \
  80. } __testjs_flag_hook_##flag;
  81. #define TEST_ROOT(path) \
  82. String Test::JS::g_test_root_fragment = path
  83. #define TESTJS_RUN_FILE_FUNCTION(...) \
  84. struct __TestJS_run_file { \
  85. __TestJS_run_file() \
  86. { \
  87. ::Test::JS::g_run_file = hook; \
  88. } \
  89. static ::Test::JS::IntermediateRunFileResult hook(String const&, JS::Interpreter&, JS::ExecutionContext&); \
  90. } __testjs_common_run_file {}; \
  91. ::Test::JS::IntermediateRunFileResult __TestJS_run_file::hook(__VA_ARGS__)
  92. #define TESTJS_CREATE_INTERPRETER_HOOK(...) \
  93. struct __TestJS_create_interpreter_hook { \
  94. __TestJS_create_interpreter_hook() \
  95. { \
  96. ::Test::JS::g_create_interpreter_hook = hook; \
  97. } \
  98. static NonnullOwnPtr<JS::Interpreter> hook(); \
  99. } __testjs_create_interpreter_hook {}; \
  100. NonnullOwnPtr<JS::Interpreter> __TestJS_create_interpreter_hook::hook(__VA_ARGS__)
  101. namespace Test::JS {
  102. namespace JS = ::JS;
  103. template<typename... Args>
  104. static consteval size_t __testjs_count(Args...) { return sizeof...(Args); }
  105. template<auto... Values>
  106. static consteval size_t __testjs_last()
  107. {
  108. Array values { Values... };
  109. return values[values.size() - 1U];
  110. }
  111. static constexpr auto TOP_LEVEL_TEST_NAME = "__$$TOP_LEVEL$$__";
  112. extern RefPtr<JS::VM> g_vm;
  113. extern bool g_collect_on_every_allocation;
  114. extern bool g_run_bytecode;
  115. extern String g_currently_running_test;
  116. struct FunctionWithLength {
  117. JS::ThrowCompletionOr<JS::Value> (*function)(JS::VM&);
  118. size_t length { 0 };
  119. };
  120. extern HashMap<String, FunctionWithLength> s_exposed_global_functions;
  121. extern String g_test_root_fragment;
  122. extern String g_test_root;
  123. extern int g_test_argc;
  124. extern char** g_test_argv;
  125. extern Function<void()> g_main_hook;
  126. extern Function<NonnullOwnPtr<JS::Interpreter>()> g_create_interpreter_hook;
  127. extern HashMap<bool*, Tuple<String, String, char>> g_extra_args;
  128. struct ParserError {
  129. JS::Parser::Error error;
  130. String hint;
  131. };
  132. struct JSFileResult {
  133. String name;
  134. Optional<ParserError> error {};
  135. double time_taken { 0 };
  136. // A failed test takes precedence over a skipped test, which both have
  137. // precedence over a passed test
  138. Test::Result most_severe_test_result { Test::Result::Pass };
  139. Vector<Test::Suite> suites {};
  140. Vector<String> logged_messages {};
  141. };
  142. enum class RunFileHookResult {
  143. RunAsNormal,
  144. SkipFile,
  145. };
  146. using IntermediateRunFileResult = AK::Result<JSFileResult, RunFileHookResult>;
  147. extern IntermediateRunFileResult (*g_run_file)(String const&, JS::Interpreter&, JS::ExecutionContext&);
  148. class TestRunner : public ::Test::TestRunner {
  149. public:
  150. TestRunner(String test_root, String common_path, bool print_times, bool print_progress, bool print_json, bool detailed_json)
  151. : ::Test::TestRunner(move(test_root), print_times, print_progress, print_json, detailed_json)
  152. , m_common_path(move(common_path))
  153. {
  154. g_test_root = m_test_root;
  155. }
  156. virtual ~TestRunner() = default;
  157. protected:
  158. virtual void do_run_single_test(String const& test_path, size_t, size_t) override;
  159. virtual Vector<String> get_test_paths() const override;
  160. virtual JSFileResult run_file_test(String const& test_path);
  161. void print_file_result(JSFileResult const& file_result) const;
  162. String m_common_path;
  163. };
  164. class TestRunnerGlobalObject final : public JS::GlobalObject {
  165. JS_OBJECT(TestRunnerGlobalObject, JS::GlobalObject);
  166. public:
  167. TestRunnerGlobalObject(JS::Realm& realm)
  168. : JS::GlobalObject(realm)
  169. {
  170. }
  171. virtual void initialize(JS::Realm&) override;
  172. virtual ~TestRunnerGlobalObject() override = default;
  173. };
  174. inline void TestRunnerGlobalObject::initialize(JS::Realm& realm)
  175. {
  176. Base::initialize(realm);
  177. define_direct_property("global", this, JS::Attribute::Enumerable);
  178. for (auto& entry : s_exposed_global_functions) {
  179. define_native_function(
  180. realm,
  181. entry.key, [fn = entry.value.function](auto& vm) {
  182. return fn(vm);
  183. },
  184. entry.value.length, JS::default_attributes);
  185. }
  186. }
  187. inline ByteBuffer load_entire_file(StringView path)
  188. {
  189. auto try_load_entire_file = [](StringView const& path) -> ErrorOr<ByteBuffer> {
  190. auto file = TRY(Core::Stream::File::open(path, Core::Stream::OpenMode::Read));
  191. auto file_size = TRY(file->size());
  192. auto content = TRY(ByteBuffer::create_uninitialized(file_size));
  193. TRY(file->read(content.bytes()));
  194. return content;
  195. };
  196. auto buffer_or_error = try_load_entire_file(path);
  197. if (buffer_or_error.is_error()) {
  198. warnln("Failed to open the following file: \"{}\", error: {}", path, buffer_or_error.release_error());
  199. cleanup_and_exit();
  200. }
  201. return buffer_or_error.release_value();
  202. }
  203. inline AK::Result<JS::NonnullGCPtr<JS::Script>, ParserError> parse_script(StringView path, JS::Realm& realm)
  204. {
  205. auto contents = load_entire_file(path);
  206. auto script_or_errors = JS::Script::parse(contents, realm, path);
  207. if (script_or_errors.is_error()) {
  208. auto errors = script_or_errors.release_error();
  209. return ParserError { errors[0], errors[0].source_location_hint(contents) };
  210. }
  211. return script_or_errors.release_value();
  212. }
  213. inline AK::Result<JS::NonnullGCPtr<JS::SourceTextModule>, ParserError> parse_module(StringView path, JS::Realm& realm)
  214. {
  215. auto contents = load_entire_file(path);
  216. auto script_or_errors = JS::SourceTextModule::parse(contents, realm, path);
  217. if (script_or_errors.is_error()) {
  218. auto errors = script_or_errors.release_error();
  219. return ParserError { errors[0], errors[0].source_location_hint(contents) };
  220. }
  221. return script_or_errors.release_value();
  222. }
  223. inline ErrorOr<JsonValue> get_test_results(JS::Interpreter& interpreter)
  224. {
  225. auto results = MUST(interpreter.realm().global_object().get("__TestResults__"));
  226. auto json_string = MUST(JS::JSONObject::stringify_impl(*g_vm, results, JS::js_undefined(), JS::js_undefined()));
  227. return JsonValue::from_string(json_string);
  228. }
  229. inline void TestRunner::do_run_single_test(String const& test_path, size_t, size_t)
  230. {
  231. auto file_result = run_file_test(test_path);
  232. if (!m_print_json)
  233. print_file_result(file_result);
  234. if (needs_detailed_suites())
  235. ensure_suites().extend(file_result.suites);
  236. }
  237. inline Vector<String> TestRunner::get_test_paths() const
  238. {
  239. Vector<String> paths;
  240. iterate_directory_recursively(m_test_root, [&](String const& file_path) {
  241. if (!file_path.ends_with(".js"sv))
  242. return;
  243. if (!file_path.ends_with("test-common.js"sv))
  244. paths.append(file_path);
  245. });
  246. quick_sort(paths);
  247. return paths;
  248. }
  249. inline JSFileResult TestRunner::run_file_test(String const& test_path)
  250. {
  251. g_currently_running_test = test_path;
  252. #ifdef AK_OS_SERENITY
  253. auto string_id = perf_register_string(test_path.characters(), test_path.length());
  254. perf_event(PERF_EVENT_SIGNPOST, string_id, 0);
  255. #endif
  256. double start_time = get_time_in_ms();
  257. auto interpreter = JS::Interpreter::create<TestRunnerGlobalObject>(*g_vm);
  258. // Since g_vm is reused for each new interpreter, Interpreter::create will end up pushing multiple
  259. // global execution contexts onto the VM's execution context stack. To prevent this, we immediately
  260. // pop the global execution context off the execution context stack and manually handle pushing
  261. // and popping it. Since the global execution context should be the only thing on the stack
  262. // at interpreter creation, let's assert there is only one.
  263. VERIFY(g_vm->execution_context_stack().size() == 1);
  264. auto& global_execution_context = *g_vm->execution_context_stack().take_first();
  265. // FIXME: This is a hack while we're refactoring Interpreter/VM stuff.
  266. JS::VM::InterpreterExecutionScope scope(*interpreter);
  267. interpreter->heap().set_should_collect_on_every_allocation(g_collect_on_every_allocation);
  268. if (g_run_file) {
  269. auto result = g_run_file(test_path, *interpreter, global_execution_context);
  270. if (result.is_error() && result.error() == RunFileHookResult::SkipFile) {
  271. return {
  272. test_path,
  273. {},
  274. 0,
  275. Test::Result::Skip,
  276. {},
  277. {}
  278. };
  279. }
  280. if (!result.is_error()) {
  281. auto value = result.release_value();
  282. for (auto& suite : value.suites) {
  283. if (suite.most_severe_test_result == Result::Pass)
  284. m_counts.suites_passed++;
  285. else if (suite.most_severe_test_result == Result::Fail)
  286. m_counts.suites_failed++;
  287. for (auto& test : suite.tests) {
  288. if (test.result == Result::Pass)
  289. m_counts.tests_passed++;
  290. else if (test.result == Result::Fail)
  291. m_counts.tests_failed++;
  292. else if (test.result == Result::Skip)
  293. m_counts.tests_skipped++;
  294. }
  295. }
  296. ++m_counts.files_total;
  297. m_total_elapsed_time_in_ms += value.time_taken;
  298. return value;
  299. }
  300. }
  301. // FIXME: Since a new interpreter is created every time with a new realm, we no longer cache the test-common.js file as scripts are parsed for the current realm only.
  302. // Find a way to cache this.
  303. auto result = parse_script(m_common_path, interpreter->realm());
  304. if (result.is_error()) {
  305. warnln("Unable to parse test-common.js");
  306. warnln("{}", result.error().error.to_string());
  307. warnln("{}", result.error().hint);
  308. cleanup_and_exit();
  309. }
  310. auto test_script = result.release_value();
  311. if (g_run_bytecode) {
  312. auto executable = MUST(JS::Bytecode::Generator::generate(test_script->parse_node()));
  313. executable->name = test_path;
  314. if (JS::Bytecode::g_dump_bytecode)
  315. executable->dump();
  316. JS::Bytecode::Interpreter bytecode_interpreter(interpreter->realm());
  317. MUST(bytecode_interpreter.run(*executable));
  318. } else {
  319. g_vm->push_execution_context(global_execution_context);
  320. MUST(interpreter->run(*test_script));
  321. g_vm->pop_execution_context();
  322. }
  323. auto file_script = parse_script(test_path, interpreter->realm());
  324. if (file_script.is_error())
  325. return { test_path, file_script.error() };
  326. if (g_run_bytecode) {
  327. auto executable_result = JS::Bytecode::Generator::generate(file_script.value()->parse_node());
  328. if (!executable_result.is_error()) {
  329. auto executable = executable_result.release_value();
  330. executable->name = test_path;
  331. if (JS::Bytecode::g_dump_bytecode)
  332. executable->dump();
  333. JS::Bytecode::Interpreter bytecode_interpreter(interpreter->realm());
  334. (void)bytecode_interpreter.run(*executable);
  335. }
  336. } else {
  337. g_vm->push_execution_context(global_execution_context);
  338. (void)interpreter->run(file_script.value());
  339. g_vm->pop_execution_context();
  340. }
  341. g_vm->push_execution_context(global_execution_context);
  342. auto test_json = get_test_results(*interpreter);
  343. g_vm->pop_execution_context();
  344. if (test_json.is_error()) {
  345. warnln("Received malformed JSON from test \"{}\"", test_path);
  346. cleanup_and_exit();
  347. }
  348. JSFileResult file_result { test_path.substring(m_test_root.length() + 1, test_path.length() - m_test_root.length() - 1) };
  349. // Collect logged messages
  350. auto user_output = MUST(interpreter->realm().global_object().get("__UserOutput__"));
  351. auto& arr = user_output.as_array();
  352. for (auto& entry : arr.indexed_properties()) {
  353. auto message = MUST(arr.get(entry.index()));
  354. file_result.logged_messages.append(message.to_string_without_side_effects());
  355. }
  356. test_json.value().as_object().for_each_member([&](String const& suite_name, JsonValue const& suite_value) {
  357. Test::Suite suite { test_path, suite_name };
  358. VERIFY(suite_value.is_object());
  359. suite_value.as_object().for_each_member([&](const String& test_name, const JsonValue& test_value) {
  360. Test::Case test { test_name, Test::Result::Fail, "", 0 };
  361. VERIFY(test_value.is_object());
  362. VERIFY(test_value.as_object().has("result"sv));
  363. auto result = test_value.as_object().get("result"sv);
  364. VERIFY(result.is_string());
  365. auto result_string = result.as_string();
  366. if (result_string == "pass") {
  367. test.result = Test::Result::Pass;
  368. m_counts.tests_passed++;
  369. } else if (result_string == "fail") {
  370. test.result = Test::Result::Fail;
  371. m_counts.tests_failed++;
  372. suite.most_severe_test_result = Test::Result::Fail;
  373. VERIFY(test_value.as_object().has("details"sv));
  374. auto details = test_value.as_object().get("details"sv);
  375. VERIFY(result.is_string());
  376. test.details = details.as_string();
  377. } else {
  378. test.result = Test::Result::Skip;
  379. if (suite.most_severe_test_result == Test::Result::Pass)
  380. suite.most_severe_test_result = Test::Result::Skip;
  381. m_counts.tests_skipped++;
  382. }
  383. test.duration_us = test_value.as_object().get("duration"sv).to_u64(0);
  384. suite.tests.append(test);
  385. });
  386. if (suite.most_severe_test_result == Test::Result::Fail) {
  387. m_counts.suites_failed++;
  388. file_result.most_severe_test_result = Test::Result::Fail;
  389. } else {
  390. if (suite.most_severe_test_result == Test::Result::Skip && file_result.most_severe_test_result == Test::Result::Pass)
  391. file_result.most_severe_test_result = Test::Result::Skip;
  392. m_counts.suites_passed++;
  393. }
  394. file_result.suites.append(suite);
  395. });
  396. m_counts.files_total++;
  397. file_result.time_taken = get_time_in_ms() - start_time;
  398. m_total_elapsed_time_in_ms += file_result.time_taken;
  399. return file_result;
  400. }
  401. inline void TestRunner::print_file_result(JSFileResult const& file_result) const
  402. {
  403. if (file_result.most_severe_test_result == Test::Result::Fail || file_result.error.has_value()) {
  404. print_modifiers({ BG_RED, FG_BLACK, FG_BOLD });
  405. out(" FAIL ");
  406. print_modifiers({ CLEAR });
  407. } else {
  408. if (m_print_times || file_result.most_severe_test_result != Test::Result::Pass) {
  409. print_modifiers({ BG_GREEN, FG_BLACK, FG_BOLD });
  410. out(" PASS ");
  411. print_modifiers({ CLEAR });
  412. } else {
  413. return;
  414. }
  415. }
  416. out(" {}", file_result.name);
  417. if (m_print_times) {
  418. print_modifiers({ CLEAR, ITALIC, FG_GRAY });
  419. if (file_result.time_taken < 1000) {
  420. outln(" ({}ms)", static_cast<int>(file_result.time_taken));
  421. } else {
  422. outln(" ({:3}s)", file_result.time_taken / 1000.0);
  423. }
  424. print_modifiers({ CLEAR });
  425. } else {
  426. outln();
  427. }
  428. if (!file_result.logged_messages.is_empty()) {
  429. print_modifiers({ FG_GRAY, FG_BOLD });
  430. #ifdef AK_OS_SERENITY
  431. outln(" ℹ Console output:");
  432. #else
  433. // This emoji has a second invisible byte after it. The one above does not
  434. outln(" ℹ️ Console output:");
  435. #endif
  436. print_modifiers({ CLEAR, FG_GRAY });
  437. for (auto& message : file_result.logged_messages)
  438. outln(" {}", message);
  439. }
  440. if (file_result.error.has_value()) {
  441. auto test_error = file_result.error.value();
  442. print_modifiers({ FG_RED });
  443. #ifdef AK_OS_SERENITY
  444. outln(" ❌ The file failed to parse");
  445. #else
  446. // No invisible byte here, but the spacing still needs to be altered on the host
  447. outln(" ❌ The file failed to parse");
  448. #endif
  449. outln();
  450. print_modifiers({ FG_GRAY });
  451. for (auto& message : test_error.hint.split('\n', SplitBehavior::KeepEmpty)) {
  452. outln(" {}", message);
  453. }
  454. print_modifiers({ FG_RED });
  455. outln(" {}", test_error.error.to_string());
  456. outln();
  457. return;
  458. }
  459. if (file_result.most_severe_test_result != Test::Result::Pass) {
  460. for (auto& suite : file_result.suites) {
  461. if (suite.most_severe_test_result == Test::Result::Pass)
  462. continue;
  463. bool failed = suite.most_severe_test_result == Test::Result::Fail;
  464. print_modifiers({ FG_GRAY, FG_BOLD });
  465. if (failed) {
  466. #ifdef AK_OS_SERENITY
  467. out(" ❌ Suite: ");
  468. #else
  469. // No invisible byte here, but the spacing still needs to be altered on the host
  470. out(" ❌ Suite: ");
  471. #endif
  472. } else {
  473. #ifdef AK_OS_SERENITY
  474. out(" ⚠ Suite: ");
  475. #else
  476. // This emoji has a second invisible byte after it. The one above does not
  477. out(" ⚠️ Suite: ");
  478. #endif
  479. }
  480. print_modifiers({ CLEAR, FG_GRAY });
  481. if (suite.name == TOP_LEVEL_TEST_NAME) {
  482. outln("<top-level>");
  483. } else {
  484. outln("{}", suite.name);
  485. }
  486. print_modifiers({ CLEAR });
  487. for (auto& test : suite.tests) {
  488. if (test.result == Test::Result::Pass)
  489. continue;
  490. print_modifiers({ FG_GRAY, FG_BOLD });
  491. out(" Test: ");
  492. if (test.result == Test::Result::Fail) {
  493. print_modifiers({ CLEAR, FG_RED });
  494. outln("{} (failed):", test.name);
  495. outln(" {}", test.details);
  496. } else {
  497. print_modifiers({ CLEAR, FG_ORANGE });
  498. outln("{} (skipped)", test.name);
  499. }
  500. print_modifiers({ CLEAR });
  501. }
  502. }
  503. }
  504. }
  505. }