From 46c0cab763380a1ecbdf93e309257de4e37a7341 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Tue, 5 Jan 2021 22:10:50 +0100 Subject: refactor(core): simplify Deno.core initialisation, remove stale TODO (#8847) This commit rewrites initialisation of the "shared queue" and in effect prevents from double execution of "core/core.js" and "core/error.js". Previously both of these files were executed every time a "JsRuntime" was created. That lead to a situation where one copy of each script was included in the snapshot and then another copy would be executed after loading the snapshot. Effectively "JsRuntime::shared_init" was removed; instead execution of those scripts and actual initialisation of shared queue was split into two helper functions: "JsRuntime::js_init" and "JsRuntime::share_queue_init". Additionally stale TODO comments were removed. --- cli/tsc/99_main_compiler.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'cli/tsc') diff --git a/cli/tsc/99_main_compiler.js b/cli/tsc/99_main_compiler.js index d65aaa4c1..57e52f562 100644 --- a/cli/tsc/99_main_compiler.js +++ b/cli/tsc/99_main_compiler.js @@ -597,7 +597,6 @@ delete Object.prototype.__proto__; hasStarted = true; languageService = ts.createLanguageService(host); core.ops(); - core.registerErrorClass("Error", Error); setLogDebug(debugFlag, "TSLS"); debug("serverInit()"); } @@ -613,7 +612,6 @@ delete Object.prototype.__proto__; } hasStarted = true; core.ops(); - core.registerErrorClass("Error", Error); setLogDebug(!!debugFlag, "TS"); } -- cgit v1.2.3