From 0397af79b436a69c0eb07820e1b6104d5999da06 Mon Sep 17 00:00:00 2001 From: Anton Bannykh Date: Tue, 13 Nov 2018 16:18:43 +0300 Subject: [PATCH] JS: convert from java to kotlin JsProgramFragment --- .../js/backend/ast/JsProgramFragment.java | 70 ------------------- .../js/backend/ast/JsProgramFragment.kt | 18 +++++ 2 files changed, 18 insertions(+), 70 deletions(-) delete mode 100644 js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsProgramFragment.java create mode 100644 js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsProgramFragment.kt diff --git a/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsProgramFragment.java b/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsProgramFragment.java deleted file mode 100644 index aae90a77d39..00000000000 --- a/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsProgramFragment.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package org.jetbrains.kotlin.js.backend.ast; - -import org.jetbrains.annotations.NotNull; - -import java.util.*; - -public class JsProgramFragment { - private final JsScope scope; - private final List importedModules = new ArrayList<>(); - private final Map imports = new LinkedHashMap<>(); - private final JsGlobalBlock declarationBlock = new JsGlobalBlock(); - private final JsGlobalBlock exportBlock = new JsGlobalBlock(); - private final JsGlobalBlock initializerBlock = new JsGlobalBlock(); - private final List nameBindings = new ArrayList<>(); - private final Map classes = new LinkedHashMap<>(); - private final Map inlineModuleMap = new LinkedHashMap<>(); - - public JsProgramFragment(@NotNull JsScope scope) { - this.scope = scope; - } - - @NotNull - public JsScope getScope() { - return scope; - } - - @NotNull - public List getImportedModules() { - return importedModules; - } - - @NotNull - public Map getImports() { - return imports; - } - - @NotNull - public JsGlobalBlock getDeclarationBlock() { - return declarationBlock; - } - - @NotNull - public JsGlobalBlock getExportBlock() { - return exportBlock; - } - - @NotNull - public JsGlobalBlock getInitializerBlock() { - return initializerBlock; - } - - @NotNull - public List getNameBindings() { - return nameBindings; - } - - @NotNull - public Map getClasses() { - return classes; - } - - @NotNull - public Map getInlineModuleMap() { - return inlineModuleMap; - } -} diff --git a/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsProgramFragment.kt b/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsProgramFragment.kt new file mode 100644 index 00000000000..455c765ba0f --- /dev/null +++ b/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsProgramFragment.kt @@ -0,0 +1,18 @@ +// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +package org.jetbrains.kotlin.js.backend.ast + +import java.util.* + +class JsProgramFragment(val scope: JsScope) { + val importedModules: MutableList = ArrayList() + val imports: MutableMap = LinkedHashMap() + val declarationBlock = JsGlobalBlock() + val exportBlock = JsGlobalBlock() + val initializerBlock = JsGlobalBlock() + val nameBindings: MutableList = ArrayList() + val classes: MutableMap = LinkedHashMap() + val inlineModuleMap: MutableMap = LinkedHashMap() +}