[JS IR] Add a compiler option for generating name entries in sourcemaps

This commit is contained in:
Sergej Jaskiewicz
2022-10-04 11:17:32 +02:00
committed by Space Team
parent 8f237a60f7
commit 227864c6ec
15 changed files with 191 additions and 3 deletions
@@ -38,6 +38,9 @@ public class JSConfigurationKeys {
public static final CompilerConfigurationKey<SourceMapSourceEmbedding> SOURCE_MAP_EMBED_SOURCES =
CompilerConfigurationKey.create("embed source files into source map");
public static final CompilerConfigurationKey<SourceMapNamesPolicy> SOURCEMAP_NAMES_POLICY = CompilerConfigurationKey.create(
"a policy to generate a mapping from generated identifiers to their corresponding original names");
public static final CompilerConfigurationKey<Boolean> META_INFO =
CompilerConfigurationKey.create("generate .meta.js and .kjsm files");
@@ -0,0 +1,30 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.js.config
/**
* A policy to generate name mappings in sourcemaps.
*
* Sourcemaps can map names from the generated JavaScript code to the names of the corresponding entities in the Kotlin source code.
*/
enum class SourceMapNamesPolicy {
/**
* Don't generate name mappings
*/
NO,
/**
* Generate name mappings. For functions and methods, map to their simple names instead of fully-qualified names.
*
* This is the default.
*/
SIMPLE_NAMES,
/**
* Generate name mappings. For functions and methods, map to their fully-qualified names.
*/
FULLY_QUALIFIED_NAMES,
}