From 804eb61bf03ca10092e1ff19b995d9dfd862d181 Mon Sep 17 00:00:00 2001 From: Artem Kobzar Date: Wed, 16 Feb 2022 10:49:11 +0000 Subject: [PATCH] feat: add polyfills insertion for ES Next used features --- .../ir/backend/js/JsIrBackendContext.kt | 3 +- .../kotlin/ir/backend/js/compiler.kt | 3 + .../kotlin/ir/backend/js/compilerWithIC.kt | 2 + .../jetbrains/kotlin/ir/backend/js/dce/Dce.kt | 12 +- .../js/dce/UsefulDeclarationProcessor.kt | 17 +- .../js/lower/CollectNativeImplementations.kt | 33 + .../IrElementToJsExpressionTransformer.kt | 8 - .../IrElementToJsStatementTransformer.kt | 5 +- .../irToJs/IrModuleToJsTransformer.kt | 22 +- .../irToJs/IrModuleToJsTransformerTmp.kt | 19 +- .../irToJs/JsIrProgramFragment.kt | 7 +- .../js/transformers/irToJs/JsPolyfills.kt | 39 + .../transformers/irToJs/JsPolyfillsVisitor.kt | 28 - .../backend/js/transformers/irToJs/Merger.kt | 27 +- .../ir/backend/js/utils/AnnotationUtils.kt | 9 +- .../ir/backend/js/utils/JsStaticContext.kt | 2 - .../serialization/JsIrAstDeserializer.kt | 5 +- .../utils/serialization/JsIrAstSerializer.kt | 2 + .../backend/JsToStringGenerationVisitor.java | 1 - js/js.serializer/src/js-ast.proto | 5 + .../serialization/js/ast/JsAstProtoBuf.java | 13067 ++++++++-------- js/js.tests/build.gradle.kts | 3 +- .../kotlin/js/test/utils/RunnerUtils.kt | 2 +- .../kotlin/js/test/BoxJsTestGenerated.java | 200 + .../js/test/ir/IrBoxJsTestGenerated.java | 428 + .../acosh/acoshWithExistedIntrinsic.kt | 27 + .../acosh/acoshWithoutExistedIntrinsic.kt | 19 + .../asinh/asinhWithExistedIntrinsic.kt | 26 + .../asinh/asinhWithoutExistedIntrinsic.kt | 18 + .../atanh/atanhWithExistedIntrinsic.kt | 26 + .../atanh/atanhWithoutExistedIntrinsic.kt | 18 + .../clz32/clz32WithExistedIntrinsic.kt | 21 + .../clz32/clz32WithoutExistedIntrinsic.kt | 14 + .../cosh/coshWithExistedIntrinsic.kt | 26 + .../cosh/coshWithoutExistedIntrinsic.kt | 18 + .../expm1/expm1WithExistedIntrinsic.kt | 26 + .../expm1/expm1WithoutExistedIntrinsic.kt | 18 + .../fill/arrayFillWithExistedIntrinsic.kt | 20 + .../fill/arrayFillWithoutExistedIntrinsic.kt | 14 + .../globalThisWithExistedIntrinsic.kt | 12 + .../globalThisWithoutExistedIntrinsic.kt | 13 + .../hypot/hypotWithExistedIntrinsic.kt | 19 + .../hypot/hypotWithoutExistedIntrinsic.kt | 16 + .../imul/imulWithExistedIntrinsic.kt | 18 + .../imul/imulWithoutExistedIntrinsic.kt | 18 + .../isView/isViewWithExistedIntrinsic.kt | 18 + .../isView/isViewWithoutExistedIntrinsic.kt | 15 + .../log10/log10WithExistedIntrinsic.kt | 19 + .../log10/log10WithoutExistedIntrinsic.kt | 16 + .../log1p/log1pWithExistedIntrinsic.kt | 25 + .../log1p/log1pWithoutExistedIntrinsic.kt | 17 + .../log2/log2WithExistedIntrinsic.kt | 19 + .../log2/log2WithoutExistedIntrinsic.kt | 16 + .../sign/signWithExistedIntrinsic.kt | 19 + .../sign/signWithoutExistedIntrinsic.kt | 16 + .../sinh/sinhWithExistedIntrinsic.kt | 26 + .../sinh/sinhWithoutExistedIntrinsic.kt | 18 + .../sort/sortWithExistedIntrinsic.kt | 18 + .../sort/sortWithoutExistedIntrinsic.kt | 15 + .../tanh/tanhWithExistedIntrinsic.kt | 26 + .../tanh/tanhWithoutExistedIntrinsic.kt | 17 + .../trunc/truncWithExistedIntrinsic.kt | 25 + .../trunc/truncWithoutExistedIntrinsic.kt | 16 + libraries/stdlib/js-ir/runtime/globalThis.kt | 2 +- libraries/stdlib/js-ir/runtime/math.kt | 4 +- .../stdlib/js-ir/runtime/typeCheckUtils.kt | 4 +- .../stdlib/js-ir/src/generated/_ArraysJs.kt | 44 +- .../stdlib/js/src/generated/_ArraysJs.kt | 32 +- libraries/stdlib/js/src/kotlin/ArrayBuffer.kt | 17 + libraries/stdlib/js/src/kotlin/collections.kt | 3 +- .../js/src/kotlin/internalAnnotations.kt | 2 +- .../stdlib/js/src/kotlin/js.arrays/fill.kt | 66 + .../stdlib/js/src/kotlin/js.arrays/sort.kt | 33 + .../stdlib/js/src/kotlin/{ => js}/js.math.kt | 36 +- .../stdlib/js/src/kotlin/js/math.polyfills.kt | 308 + libraries/stdlib/js/src/kotlin/math.kt | 54 +- libraries/stdlib/js/src/kotlin/numbers.kt | 2 +- libraries/stdlib/js/src/kotlin/text/string.kt | 25 + .../kotlin-stdlib-gen/src/templates/Arrays.kt | 8 +- license/README.md | 4 + 80 files changed, 8769 insertions(+), 6552 deletions(-) create mode 100644 compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/CollectNativeImplementations.kt create mode 100644 compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsPolyfills.kt delete mode 100644 compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsPolyfillsVisitor.kt create mode 100644 js/js.translator/testData/box/polyfills/acosh/acoshWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/acosh/acoshWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/asinh/asinhWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/asinh/asinhWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/atanh/atanhWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/atanh/atanhWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/clz32/clz32WithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/clz32/clz32WithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/cosh/coshWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/cosh/coshWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/expm1/expm1WithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/expm1/expm1WithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/fill/arrayFillWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/fill/arrayFillWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/globalThis/globalThisWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/globalThis/globalThisWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/hypot/hypotWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/hypot/hypotWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/imul/imulWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/imul/imulWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/isView/isViewWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/isView/isViewWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/log10/log10WithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/log10/log10WithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/log1p/log1pWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/log1p/log1pWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/log2/log2WithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/log2/log2WithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/sign/signWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/sign/signWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/sinh/sinhWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/sinh/sinhWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/sort/sortWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/sort/sortWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/tanh/tanhWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/tanh/tanhWithoutExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/trunc/truncWithExistedIntrinsic.kt create mode 100644 js/js.translator/testData/box/polyfills/trunc/truncWithoutExistedIntrinsic.kt create mode 100644 libraries/stdlib/js/src/kotlin/ArrayBuffer.kt create mode 100644 libraries/stdlib/js/src/kotlin/js.arrays/fill.kt create mode 100644 libraries/stdlib/js/src/kotlin/js.arrays/sort.kt rename libraries/stdlib/js/src/kotlin/{ => js}/js.math.kt (67%) create mode 100644 libraries/stdlib/js/src/kotlin/js/math.polyfills.kt diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt index 4d65d5db041..c3dc3c846ce 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/JsIrBackendContext.kt @@ -20,6 +20,7 @@ import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.backend.js.codegen.JsGenerationGranularity import org.jetbrains.kotlin.ir.backend.js.ir.JsIrBuilder import org.jetbrains.kotlin.ir.backend.js.lower.JsInnerClassesSupport +import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsPolyfills import org.jetbrains.kotlin.ir.backend.js.utils.JsInlineClassesUtils import org.jetbrains.kotlin.ir.backend.js.utils.OperatorNames import org.jetbrains.kotlin.ir.builders.declarations.addFunction @@ -65,7 +66,7 @@ class JsIrBackendContext( val granularity: JsGenerationGranularity = JsGenerationGranularity.WHOLE_PROGRAM, val icCompatibleIr2Js: Boolean = false, ) : JsCommonBackendContext { - + val polyfills = JsPolyfills() val fieldToInitializer: MutableMap = mutableMapOf() val localClassNames: MutableMap = mutableMapOf() diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt index 3b0cbf10c7f..0a13b40eeaf 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compiler.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.backend.common.phaser.invokeToplevel import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.ir.IrBuiltIns import org.jetbrains.kotlin.ir.backend.js.codegen.JsGenerationGranularity +import org.jetbrains.kotlin.ir.backend.js.lower.collectNativeImplementations import org.jetbrains.kotlin.ir.backend.js.lower.generateJsTests import org.jetbrains.kotlin.ir.backend.js.lower.moveBodilessDeclarationsToSeparatePlace import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsIrLinker @@ -140,6 +141,7 @@ fun compileIr( } allModules.forEach { module -> + collectNativeImplementations(context, module) moveBodilessDeclarationsToSeparatePlace(context, module) } @@ -158,6 +160,7 @@ fun generateJsCode( moduleFragment: IrModuleFragment, nameTables: NameTables ): String { + collectNativeImplementations(context, moduleFragment) moveBodilessDeclarationsToSeparatePlace(context, moduleFragment) jsPhases.invokeToplevel(PhaseConfig(jsPhases), context, listOf(moduleFragment)) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compilerWithIC.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compilerWithIC.kt index df0bd3443b4..0422b4a36de 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compilerWithIC.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/compilerWithIC.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.config.CompilerConfiguration import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI import org.jetbrains.kotlin.ir.backend.js.ic.ModuleCache import org.jetbrains.kotlin.ir.backend.js.ic.PersistentCacheConsumer +import org.jetbrains.kotlin.ir.backend.js.lower.collectNativeImplementations import org.jetbrains.kotlin.ir.backend.js.lower.generateJsTests import org.jetbrains.kotlin.ir.backend.js.lower.moveBodilessDeclarationsToSeparatePlace import org.jetbrains.kotlin.ir.backend.js.lower.serialization.ir.JsIrLinker @@ -80,6 +81,7 @@ fun compileWithIC( symbolTable.noUnboundLeft("Unbound symbols at the end of linker") allModules.forEach { + collectNativeImplementations(context, module) moveBodilessDeclarationsToSeparatePlace(context, it) } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/dce/Dce.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/dce/Dce.kt index c5272d89319..c57c571fc24 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/dce/Dce.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/dce/Dce.kt @@ -34,9 +34,11 @@ fun eliminateDeadDeclarations( val uselessDeclarationsProcessor = UselessDeclarationsRemover(removeUnusedAssociatedObjects, usefulDeclarations, context, context.dceRuntimeDiagnostic) + modules.forEach { module -> module.files.forEach { it.acceptVoid(uselessDeclarationsProcessor) + context.polyfills.saveOnlyIntersectionOfNextDeclarationsFor(it, usefulDeclarations) } } } @@ -55,7 +57,15 @@ private fun IrDeclaration.addRootsTo( setter?.addRootsTo(nestedVisitor, context) } isEffectivelyExternal() -> { - acceptVoid(nestedVisitor) + val correspondingProperty = when (this) { + is IrField -> correspondingPropertySymbol?.owner + is IrSimpleFunction -> correspondingPropertySymbol?.owner + else -> null + } + + if (!hasJsPolyfill() && correspondingProperty?.hasJsPolyfill() != true) { + acceptVoid(nestedVisitor) + } } isExported(context) -> { acceptVoid(nestedVisitor) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/dce/UsefulDeclarationProcessor.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/dce/UsefulDeclarationProcessor.kt index ef76155000b..b9a88896753 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/dce/UsefulDeclarationProcessor.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/dce/UsefulDeclarationProcessor.kt @@ -55,9 +55,24 @@ abstract class UsefulDeclarationProcessor( expression.symbol.owner.enqueue(data, "raw function access") } + override fun visitBlock(expression: IrBlock, data: IrDeclaration) { + super.visitBlock(expression, data) + if (expression !is IrReturnableBlock) return + expression.inlineFunctionSymbol?.owner?.enqueue(data, "inline function usage") + } + override fun visitFieldAccess(expression: IrFieldAccessExpression, data: IrDeclaration) { super.visitFieldAccess(expression, data) - expression.symbol.owner.enqueue(data, "field access") + + val field = expression.symbol.owner.apply { enqueue(data, "field access") } + val correspondingProperty = field.correspondingPropertySymbol?.owner ?: return + + if ( + field.origin == IrDeclarationOrigin.PROPERTY_BACKING_FIELD && + correspondingProperty.hasJsPolyfill() + ) { + correspondingProperty.enqueue(field, "property backing field") + } } override fun visitStringConcatenation(expression: IrStringConcatenation, data: IrDeclaration) { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/CollectNativeImplementations.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/CollectNativeImplementations.kt new file mode 100644 index 00000000000..cb1ede0f6b2 --- /dev/null +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/CollectNativeImplementations.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2021 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.ir.backend.js.lower + +import org.jetbrains.kotlin.backend.common.DeclarationTransformer +import org.jetbrains.kotlin.ir.IrElement +import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext +import org.jetbrains.kotlin.ir.declarations.IrDeclarationBase +import org.jetbrains.kotlin.ir.declarations.IrExternalPackageFragment +import org.jetbrains.kotlin.ir.declarations.IrFile +import org.jetbrains.kotlin.ir.declarations.IrModuleFragment +import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid +import org.jetbrains.kotlin.ir.visitors.acceptChildrenVoid + +fun collectNativeImplementations(context: JsIrBackendContext, moduleFragment: IrModuleFragment) = + CollectNativeImplementationsVisitor(context).let { collector -> + moduleFragment.files.forEach { it.accept(collector, null) } + } + + +class CollectNativeImplementationsVisitor(private val context: JsIrBackendContext) : IrElementVisitorVoid { + override fun visitElement(element: IrElement) {} + + override fun visitFile(declaration: IrFile) { + declaration.declarations.forEach { + context.polyfills.registerDeclarationNativeImplementation(declaration, it) + } + super.visitFile(declaration) + } +} diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsExpressionTransformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsExpressionTransformer.kt index 617a818e914..7ab74155390 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsExpressionTransformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsExpressionTransformer.kt @@ -114,7 +114,6 @@ class IrElementToJsExpressionTransformer : BaseIrElementToJsNodeTransformer @@ -112,7 +112,7 @@ class IrModuleToJsTransformer( ExportedModule(moduleName, exportedModule.moduleKind, exportedDeclarations), namer, refInfo, - generateMainCall = false + generateMainCall = false, ) }.reversed() @@ -123,7 +123,8 @@ class IrModuleToJsTransformer( emptyList(), exportedModule, namer, - EmptyCrossModuleReferenceInfo + EmptyCrossModuleReferenceInfo, + generateMainCall = true, ) } } @@ -134,7 +135,7 @@ class IrModuleToJsTransformer( exportedModule: ExportedModule, namer: NameTables, refInfo: CrossModuleReferenceInfo, - generateMainCall: Boolean = true + generateMainCall: Boolean = true, ): CompilationOutputs { val nameGenerator = refInfo.withReferenceTracking( @@ -147,6 +148,7 @@ class IrModuleToJsTransformer( globalNameScope = namer.globalNames ) + val polyfillStatements = generatePolyfillStatements(modules) val (importStatements, importedJsModules) = generateImportStatements( getNameForExternalDeclaration = { staticContext.getNameForStaticDeclaration(it) }, @@ -163,8 +165,10 @@ class IrModuleToJsTransformer( val crossModuleExports = generateCrossModuleExports(modules, refInfo, internalModuleName) val program = JsProgram() + if (generateScriptModule) { with(program.globalBlock) { + statements.addWithComment("block: polyfills", polyfillStatements) statements.addWithComment("block: imports", importStatements + crossModuleImports) statements += moduleBody statements.addWithComment("block: exports", exportStatements + crossModuleExports) @@ -185,6 +189,7 @@ class IrModuleToJsTransformer( } } + program.globalBlock.statements.addWithComment("block: polyfills", polyfillStatements) program.globalBlock.statements += ModuleWrapperTranslation.wrap( exportedModule.name, rootFunction, @@ -223,7 +228,6 @@ class IrModuleToJsTransformer( null } - staticContext.polyfills.addAllNeededPolyfillsTo(jsCode) program.accept(JsToStringGenerationVisitor(jsCode, sourceMapBuilderConsumer ?: NoOpSourceLocationConsumer)) return CompilationOutputs( @@ -290,7 +294,6 @@ class IrModuleToJsTransformer( val statements = mutableListOf() val preDeclarationBlock = JsGlobalBlock() - val postDeclarationBlock = JsGlobalBlock() statements.addWithComment("block: pre-declaration", preDeclarationBlock) @@ -394,6 +397,13 @@ class IrModuleToJsTransformer( } ?: emptyList() } + private fun generatePolyfillStatements(modules: Iterable): List { + return modules.asSequence() + .flatMap { it.files } + .flatMap { backendContext.polyfills.getAllPolyfillsFor(it) } + .toList() + } + private fun generateImportStatements( getNameForExternalDeclaration: (IrDeclarationWithName) -> JsName, declareFreshGlobal: (String) -> JsName diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformerTmp.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformerTmp.kt index 5a0c9e59130..61a152cea4d 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformerTmp.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrModuleToJsTransformerTmp.kt @@ -147,13 +147,16 @@ class IrModuleToJsTransformerTmp( modules: Iterable, exportData: Map>>, ): JsIrProgram { - return JsIrProgram( modules.map { m -> - JsIrModule(m.safeName, m.externalModuleName(), m.files.map { f -> - val exports = exportData[m]!![f]!! - generateProgramFragment(f, exports) - }) + JsIrModule( + m.safeName, + m.externalModuleName(), + m.files.map { + val exports = exportData[m]!![it]!! + generateProgramFragment(it, exports) + }, + ) } ) } @@ -172,7 +175,9 @@ class IrModuleToJsTransformerTmp( globalNameScope = globalNameScope ) - val result = JsIrProgramFragment(file.fqName.asString()) + val result = JsIrProgramFragment(file.fqName.asString()).apply { + polyfills.statements += backendContext.polyfills.getAllPolyfillsFor(file) + } val internalModuleName = ReservedJsNames.makeInternalModuleName() val globalNames = NameTable(globalNameScope) @@ -364,7 +369,7 @@ private fun generateSingleWrappedModuleBody( sourceMapsInfo: SourceMapsInfo?, generateScriptModule: Boolean, generateCallToMain: Boolean, - crossModuleReferences: CrossModuleReferences = CrossModuleReferences.Empty + crossModuleReferences: CrossModuleReferences = CrossModuleReferences.Empty, ): CompilationOutputs { val program = Merger( moduleName, diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsIrProgramFragment.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsIrProgramFragment.kt index cd6a993e2f7..7e51e0ce8d6 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsIrProgramFragment.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsIrProgramFragment.kt @@ -21,9 +21,14 @@ class JsIrProgramFragment(val packageFqn: String) { var testFunInvocation: JsStatement? = null var suiteFn: JsName? = null val definitions = mutableSetOf() + val polyfills = JsGlobalBlock() } -class JsIrModule(val moduleName: String, val externalModuleName: String, val fragments: List) +class JsIrModule( + val moduleName: String, + val externalModuleName: String, + val fragments: List, +) class JsIrProgram(val modules: List) { val mainModule = modules.last() diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsPolyfills.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsPolyfills.kt new file mode 100644 index 00000000000..c3ce4d86065 --- /dev/null +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsPolyfills.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2010-2021 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.ir.backend.js.transformers.irToJs + +import org.jetbrains.kotlin.ir.backend.js.utils.getJsPolyfill +import org.jetbrains.kotlin.ir.backend.js.utils.hasJsPolyfill +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.js.backend.ast.JsStatement + +class JsPolyfills { + private val polyfillsPerFile = hashMapOf>() + + fun registerDeclarationNativeImplementation(file: IrFile, declaration: IrDeclaration) { + if (!declaration.hasJsPolyfill()) return + val declarations = polyfillsPerFile[file] ?: hashSetOf() + declarations.add(declaration) + polyfillsPerFile[file] = declarations + } + + fun saveOnlyIntersectionOfNextDeclarationsFor(file: IrFile, declarations: Set) { + val polyfills = polyfillsPerFile[file] ?: return + polyfillsPerFile[file] = polyfills.intersect(declarations).toHashSet() + } + + fun getAllPolyfillsFor(file: IrFile): List = + polyfillsPerFile[file].orEmpty().asImplementationList() + + private fun Iterable.asImplementationList() = + asSequence().asImplementationList() + + private fun Sequence.asImplementationList(): List = + map { it.getJsPolyfill()!! } + .distinct() + .flatMap { parseJsCode(it).orEmpty() } + .toList() +} \ No newline at end of file diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsPolyfillsVisitor.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsPolyfillsVisitor.kt deleted file mode 100644 index e8f574a3ef8..00000000000 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/JsPolyfillsVisitor.kt +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2010-2021 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.ir.backend.js.transformers.irToJs - -import org.jetbrains.kotlin.ir.declarations.IrDeclaration -import org.jetbrains.kotlin.ir.backend.js.utils.getJsNativeImplementation -import org.jetbrains.kotlin.ir.util.isEffectivelyExternal -import org.jetbrains.kotlin.js.util.TextOutput - -class JsPolyfillsVisitor { - private val polyfills = mutableSetOf() - - fun visitDeclaration(declaration: IrDeclaration) { - if (!declaration.isEffectivelyExternal()) return - val implementation = declaration.getJsNativeImplementation() ?: return - polyfills.add(implementation) - } - - fun addAllNeededPolyfillsTo(output: TextOutput) { - if (polyfills.isEmpty()) return - output.print("// region block: polyfills") - output.print(polyfills.joinToString("\n")) - output.print("// endregion\n") - } -} \ No newline at end of file diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/Merger.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/Merger.kt index 3da97026820..8b72533fbb8 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/Merger.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/Merger.kt @@ -159,21 +159,22 @@ class Merger( linkJsNames() - val moduleBody = mutableListOf().also { - if (!generateScriptModule) it += JsStringLiteral("use strict").makeStmt() - } + val moduleBody = mutableListOf() val preDeclarationBlock = JsGlobalBlock() val postDeclarationBlock = JsGlobalBlock() + val polyfillDeclarationBlock = JsGlobalBlock() moduleBody.addWithComment("block: pre-declaration", preDeclarationBlock) val classModels = mutableMapOf() val initializerBlock = JsGlobalBlock() + fragments.forEach { moduleBody += it.declarations.statements classModels += it.classes initializerBlock.statements += it.initializers.statements + polyfillDeclarationBlock.statements += it.polyfills.statements } // sort member forwarding code @@ -213,9 +214,13 @@ class Merger( if (generateScriptModule) { with(program.globalBlock) { - this.statements.addWithComment("block: imports", importStatements) - this.statements += moduleBody - this.statements.addWithComment("block: exports", exportStatements) + if (!generateScriptModule) { + statements += JsStringLiteral("use strict").makeStmt() + } + statements.addWithComment("block: polyfills", polyfillDeclarationBlock.statements) + statements.addWithComment("block: imports", importStatements) + statements += moduleBody + statements.addWithComment("block: exports", exportStatements) } } else { val internalModuleName = ReservedJsNames.makeInternalModuleName() @@ -223,9 +228,12 @@ class Merger( parameters += JsParameter(internalModuleName) parameters += (importedJsModules).map { JsParameter(it.internalName) } with(body) { - this.statements.addWithComment("block: imports", importStatements) - this.statements += moduleBody - this.statements.addWithComment("block: exports", exportStatements) + if (!generateScriptModule) { + statements += JsStringLiteral("use strict").makeStmt() + } + statements.addWithComment("block: imports", importStatements) + statements += moduleBody + statements.addWithComment("block: exports", exportStatements) if (generateCallToMain) { callToMain?.let { this.statements += it } } @@ -233,6 +241,7 @@ class Merger( } } + program.globalBlock.statements.addWithComment("block: polyfills", polyfillDeclarationBlock.statements) program.globalBlock.statements += ModuleWrapperTranslation.wrap( moduleName, rootFunction, diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/AnnotationUtils.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/AnnotationUtils.kt index bd316cacdc9..e5281f476e7 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/AnnotationUtils.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/AnnotationUtils.kt @@ -27,7 +27,7 @@ object JsAnnotations { val jsNativeSetter = FqName("kotlin.js.nativeSetter") val jsNativeInvoke = FqName("kotlin.js.nativeInvoke") val jsFunFqn = FqName("kotlin.js.JsFun") - val jsNativeImplementationFqn = FqName("kotlin.js.JsNativeImplementation") + val JsPolyfillFqn = FqName("kotlin.js.JsPolyfill") } @Suppress("UNCHECKED_CAST") @@ -46,8 +46,11 @@ fun IrAnnotationContainer.getJsQualifier(): String? = fun IrAnnotationContainer.getJsName(): String? = getAnnotation(JsAnnotations.jsNameFqn)?.getSingleConstStringArgument() -fun IrAnnotationContainer.getJsNativeImplementation(): String? = - getAnnotation(JsAnnotations.jsNativeImplementationFqn)?.getSingleConstStringArgument() +fun IrAnnotationContainer.getJsPolyfill(): String? = + getAnnotation(JsAnnotations.JsPolyfillFqn)?.getSingleConstStringArgument() + +fun IrAnnotationContainer.hasJsPolyfill(): Boolean = + hasAnnotation(JsAnnotations.JsPolyfillFqn) fun IrAnnotationContainer.getJsFunAnnotation(): String? = getAnnotation(JsAnnotations.jsFunFqn)?.getSingleConstStringArgument() diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/JsStaticContext.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/JsStaticContext.kt index b564619a75a..325f7bc319f 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/JsStaticContext.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/JsStaticContext.kt @@ -8,7 +8,6 @@ package org.jetbrains.kotlin.ir.backend.js.utils import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIntrinsicTransformers import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIrClassModel -import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsPolyfillsVisitor import org.jetbrains.kotlin.ir.declarations.IrDeclaration import org.jetbrains.kotlin.ir.symbols.IrClassSymbol import org.jetbrains.kotlin.js.backend.ast.JsGlobalBlock @@ -20,7 +19,6 @@ class JsStaticContext( private val irNamer: IrNamer, val globalNameScope: NameTable, ) : IrNamer by irNamer { - val polyfills = JsPolyfillsVisitor() val intrinsics = JsIntrinsicTransformers(backendContext) val classModels = mutableMapOf() val coroutineImplDeclaration = backendContext.ir.symbols.coroutineImpl.owner diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstDeserializer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstDeserializer.kt index 5948644cfff..8cdc1a2ec29 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstDeserializer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstDeserializer.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.ir.backend.js.utils.serialization -import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIrClassModel import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIrIcClassModel import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIrProgramFragment import org.jetbrains.kotlin.ir.backend.js.utils.emptyScope @@ -60,6 +59,9 @@ class JsIrAstDeserializer : JsAstDeserializerBase() { if (proto.hasExportBlock()) { fragment.exports.statements += deserializeGlobalBlock(proto.exportBlock).statements } + if (proto.hasPolyfills()) { + fragment.polyfills.statements += deserializeGlobalBlock(proto.polyfills).statements + } proto.nameBindingList.associateTo(fragment.nameBindings) { nameBindingProto -> deserializeString(nameBindingProto.signatureId) to deserializeName(nameBindingProto.nameId) @@ -80,7 +82,6 @@ class JsIrAstDeserializer : JsAstDeserializerBase() { } fragment.dts = proto.dts - fragment.definitions += proto.definitionsList.map { deserializeString(it) } return fragment diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstSerializer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstSerializer.kt index 78885e3fc0f..dab00d0eb55 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstSerializer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/serialization/JsIrAstSerializer.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.JsIrProgramFragmen import org.jetbrains.kotlin.js.backend.ast.* import org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.* import org.jetbrains.kotlin.serialization.js.ast.JsAstSerializerBase +import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty import org.jetbrains.kotlin.utils.addToStdlib.safeAs import java.io.OutputStream @@ -60,6 +61,7 @@ class JsIrAstSerializer: JsAstSerializerBase() { fragmentBuilder.declarationBlock = serializeBlock(fragment.declarations) fragmentBuilder.initializerBlock = serializeBlock(fragment.initializers) fragmentBuilder.exportBlock = serializeBlock(fragment.exports) + fragmentBuilder.polyfills = serializeBlock(fragment.polyfills) for ((key, name) in fragment.nameBindings.entries) { val nameBindingBuilder = NameBinding.newBuilder() diff --git a/js/js.ast/src/org/jetbrains/kotlin/js/backend/JsToStringGenerationVisitor.java b/js/js.ast/src/org/jetbrains/kotlin/js/backend/JsToStringGenerationVisitor.java index 86fe735557b..6836b37143b 100644 --- a/js/js.ast/src/org/jetbrains/kotlin/js/backend/JsToStringGenerationVisitor.java +++ b/js/js.ast/src/org/jetbrains/kotlin/js/backend/JsToStringGenerationVisitor.java @@ -1248,7 +1248,6 @@ public class JsToStringGenerationVisitor extends JsVisitor { p.print(javaScriptString(jsImport.getModule())); } - private void newline() { p.newline(); sourceLocationConsumer.newLine(); diff --git a/js/js.serializer/src/js-ast.proto b/js/js.serializer/src/js-ast.proto index eecd3f0df64..9137a05f489 100644 --- a/js/js.serializer/src/js-ast.proto +++ b/js/js.serializer/src/js-ast.proto @@ -373,6 +373,10 @@ message Catch { message Empty { } +message Code { + required string value = 1; +} + message SingleLineComment { required string message = 1; } @@ -404,6 +408,7 @@ message Fragment { optional string dts = 15; optional int32 suite_function = 16; repeated int32 definitions = 17; + optional GlobalBlock polyfills = 18; } message InlinedLocalDeclarations { diff --git a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstProtoBuf.java b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstProtoBuf.java index 1a78479b4a0..11a509f4d49 100644 --- a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstProtoBuf.java +++ b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/ast/JsAstProtoBuf.java @@ -15665,23 +15665,2848 @@ public final class JsAstProtoBuf { */ org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment getSingleLineComment(); } - public interface SingleLineCommentOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) - org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Statement} + */ + public static final class Statement extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.Statement) + StatementOrBuilder { + // Use Statement.newBuilder() to construct. + private Statement(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Statement(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} + + private static final Statement defaultInstance; + public static Statement getDefaultInstance() { + return defaultInstance; + } + + public Statement getDefaultInstanceForType() { + return defaultInstance; + } + + private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; + private Statement( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = + org.jetbrains.kotlin.protobuf.ByteString.newOutput(); + org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = + org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 8: { + bitField0_ |= 0x00000001; + fileId_ = input.readInt32(); + break; + } + case 18: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = location_.toBuilder(); + } + location_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(location_); + location_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 24: { + bitField0_ |= 0x00000004; + synthetic_ = input.readBool(); + break; + } + case 170: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.Builder subBuilder = null; + if (statementCase_ == 21) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 21; + break; + } + case 178: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.Builder subBuilder = null; + if (statementCase_ == 22) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 22; + break; + } + case 186: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.Builder subBuilder = null; + if (statementCase_ == 23) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 23; + break; + } + case 194: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.Builder subBuilder = null; + if (statementCase_ == 24) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 24; + break; + } + case 202: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.Builder subBuilder = null; + if (statementCase_ == 25) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 25; + break; + } + case 210: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.Builder subBuilder = null; + if (statementCase_ == 26) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 26; + break; + } + case 218: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.Builder subBuilder = null; + if (statementCase_ == 27) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 27; + break; + } + case 226: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.Builder subBuilder = null; + if (statementCase_ == 28) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 28; + break; + } + case 234: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (statementCase_ == 29) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 29; + break; + } + case 242: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.Builder subBuilder = null; + if (statementCase_ == 30) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 30; + break; + } + case 250: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.Builder subBuilder = null; + if (statementCase_ == 31) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 31; + break; + } + case 258: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.Builder subBuilder = null; + if (statementCase_ == 32) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 32; + break; + } + case 266: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.Builder subBuilder = null; + if (statementCase_ == 33) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 33; + break; + } + case 274: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.Builder subBuilder = null; + if (statementCase_ == 34) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 34; + break; + } + case 282: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.Builder subBuilder = null; + if (statementCase_ == 35) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 35; + break; + } + case 290: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.Builder subBuilder = null; + if (statementCase_ == 36) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 36; + break; + } + case 298: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.Builder subBuilder = null; + if (statementCase_ == 37) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 37; + break; + } + case 306: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.Builder subBuilder = null; + if (statementCase_ == 38) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 38; + break; + } + case 314: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.Builder subBuilder = null; + if (statementCase_ == 39) { + subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_).toBuilder(); + } + statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_); + statement_ = subBuilder.buildPartial(); + } + statementCase_ = 39; + break; + } + } + } + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static org.jetbrains.kotlin.protobuf.Parser PARSER = + new org.jetbrains.kotlin.protobuf.AbstractParser() { + public Statement parsePartialFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return new Statement(input, extensionRegistry); + } + }; + + @java.lang.Override + public org.jetbrains.kotlin.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + private int statementCase_ = 0; + private java.lang.Object statement_; + public enum StatementCase + implements org.jetbrains.kotlin.protobuf.Internal.EnumLite { + RETURN_STATEMENT(21), + THROW_STATEMENT(22), + BREAK_STATEMENT(23), + CONTINUE_STATEMENT(24), + DEBUGGER(25), + EXPRESSION(26), + VARS(27), + BLOCK(28), + GLOBAL_BLOCK(29), + LABEL(30), + IF_STATEMENT(31), + SWITCH_STATEMENT(32), + WHILE_STATEMENT(33), + DO_WHILE_STATEMENT(34), + FOR_STATEMENT(35), + FOR_IN_STATEMENT(36), + TRY_STATEMENT(37), + EMPTY(38), + SINGLE_LINE_COMMENT(39), + STATEMENT_NOT_SET(0); + private int value = 0; + private StatementCase(int value) { + this.value = value; + } + public static StatementCase valueOf(int value) { + switch (value) { + case 21: return RETURN_STATEMENT; + case 22: return THROW_STATEMENT; + case 23: return BREAK_STATEMENT; + case 24: return CONTINUE_STATEMENT; + case 25: return DEBUGGER; + case 26: return EXPRESSION; + case 27: return VARS; + case 28: return BLOCK; + case 29: return GLOBAL_BLOCK; + case 30: return LABEL; + case 31: return IF_STATEMENT; + case 32: return SWITCH_STATEMENT; + case 33: return WHILE_STATEMENT; + case 34: return DO_WHILE_STATEMENT; + case 35: return FOR_STATEMENT; + case 36: return FOR_IN_STATEMENT; + case 37: return TRY_STATEMENT; + case 38: return EMPTY; + case 39: return SINGLE_LINE_COMMENT; + case 0: return STATEMENT_NOT_SET; + default: throw new java.lang.IllegalArgumentException( + "Value is undefined for this oneof enum."); + } + } + public int getNumber() { + return this.value; + } + }; + + public StatementCase + getStatementCase() { + return StatementCase.valueOf( + statementCase_); + } + + public static final int FILEID_FIELD_NUMBER = 1; + private int fileId_; + /** + * optional int32 fileId = 1; + */ + public boolean hasFileId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 fileId = 1; + */ + public int getFileId() { + return fileId_; + } + + public static final int LOCATION_FIELD_NUMBER = 2; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location location_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public boolean hasLocation() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location getLocation() { + return location_; + } + + public static final int SYNTHETIC_FIELD_NUMBER = 3; + private boolean synthetic_; + /** + * optional bool synthetic = 3 [default = false]; + */ + public boolean hasSynthetic() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bool synthetic = 3 [default = false]; + */ + public boolean getSynthetic() { + return synthetic_; + } + + public static final int RETURN_STATEMENT_FIELD_NUMBER = 21; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public boolean hasReturnStatement() { + return statementCase_ == 21; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return getReturnStatement() { + if (statementCase_ == 21) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance(); + } + + public static final int THROW_STATEMENT_FIELD_NUMBER = 22; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public boolean hasThrowStatement() { + return statementCase_ == 22; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw getThrowStatement() { + if (statementCase_ == 22) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance(); + } + + public static final int BREAK_STATEMENT_FIELD_NUMBER = 23; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public boolean hasBreakStatement() { + return statementCase_ == 23; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break getBreakStatement() { + if (statementCase_ == 23) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance(); + } + + public static final int CONTINUE_STATEMENT_FIELD_NUMBER = 24; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public boolean hasContinueStatement() { + return statementCase_ == 24; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue getContinueStatement() { + if (statementCase_ == 24) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance(); + } + + public static final int DEBUGGER_FIELD_NUMBER = 25; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public boolean hasDebugger() { + return statementCase_ == 25; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger getDebugger() { + if (statementCase_ == 25) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance(); + } + + public static final int EXPRESSION_FIELD_NUMBER = 26; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public boolean hasExpression() { + return statementCase_ == 26; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement getExpression() { + if (statementCase_ == 26) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance(); + } + + public static final int VARS_FIELD_NUMBER = 27; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public boolean hasVars() { + return statementCase_ == 27; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars getVars() { + if (statementCase_ == 27) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance(); + } + + public static final int BLOCK_FIELD_NUMBER = 28; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public boolean hasBlock() { + return statementCase_ == 28; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block getBlock() { + if (statementCase_ == 28) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance(); + } + + public static final int GLOBAL_BLOCK_FIELD_NUMBER = 29; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public boolean hasGlobalBlock() { + return statementCase_ == 29; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getGlobalBlock() { + if (statementCase_ == 29) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + } + + public static final int LABEL_FIELD_NUMBER = 30; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public boolean hasLabel() { + return statementCase_ == 30; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label getLabel() { + if (statementCase_ == 30) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance(); + } + + public static final int IF_STATEMENT_FIELD_NUMBER = 31; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public boolean hasIfStatement() { + return statementCase_ == 31; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If getIfStatement() { + if (statementCase_ == 31) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance(); + } + + public static final int SWITCH_STATEMENT_FIELD_NUMBER = 32; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public boolean hasSwitchStatement() { + return statementCase_ == 32; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch getSwitchStatement() { + if (statementCase_ == 32) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance(); + } + + public static final int WHILE_STATEMENT_FIELD_NUMBER = 33; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public boolean hasWhileStatement() { + return statementCase_ == 33; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While getWhileStatement() { + if (statementCase_ == 33) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance(); + } + + public static final int DO_WHILE_STATEMENT_FIELD_NUMBER = 34; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public boolean hasDoWhileStatement() { + return statementCase_ == 34; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile getDoWhileStatement() { + if (statementCase_ == 34) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance(); + } + + public static final int FOR_STATEMENT_FIELD_NUMBER = 35; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public boolean hasForStatement() { + return statementCase_ == 35; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For getForStatement() { + if (statementCase_ == 35) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance(); + } + + public static final int FOR_IN_STATEMENT_FIELD_NUMBER = 36; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public boolean hasForInStatement() { + return statementCase_ == 36; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn getForInStatement() { + if (statementCase_ == 36) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance(); + } + + public static final int TRY_STATEMENT_FIELD_NUMBER = 37; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public boolean hasTryStatement() { + return statementCase_ == 37; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try getTryStatement() { + if (statementCase_ == 37) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance(); + } + + public static final int EMPTY_FIELD_NUMBER = 38; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public boolean hasEmpty() { + return statementCase_ == 38; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty getEmpty() { + if (statementCase_ == 38) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance(); + } + + public static final int SINGLE_LINE_COMMENT_FIELD_NUMBER = 39; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public boolean hasSingleLineComment() { + return statementCase_ == 39; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment getSingleLineComment() { + if (statementCase_ == 39) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance(); + } + + private void initFields() { + fileId_ = 0; + location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); + synthetic_ = false; + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (hasLocation()) { + if (!getLocation().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasReturnStatement()) { + if (!getReturnStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasThrowStatement()) { + if (!getThrowStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasExpression()) { + if (!getExpression().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasVars()) { + if (!getVars().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasBlock()) { + if (!getBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasGlobalBlock()) { + if (!getGlobalBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasLabel()) { + if (!getLabel().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasIfStatement()) { + if (!getIfStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSwitchStatement()) { + if (!getSwitchStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasWhileStatement()) { + if (!getWhileStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasDoWhileStatement()) { + if (!getDoWhileStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasForStatement()) { + if (!getForStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasForInStatement()) { + if (!getForInStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasTryStatement()) { + if (!getTryStatement().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasSingleLineComment()) { + if (!getSingleLineComment().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeInt32(1, fileId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(2, location_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeBool(3, synthetic_); + } + if (statementCase_ == 21) { + output.writeMessage(21, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); + } + if (statementCase_ == 22) { + output.writeMessage(22, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); + } + if (statementCase_ == 23) { + output.writeMessage(23, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); + } + if (statementCase_ == 24) { + output.writeMessage(24, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); + } + if (statementCase_ == 25) { + output.writeMessage(25, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); + } + if (statementCase_ == 26) { + output.writeMessage(26, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); + } + if (statementCase_ == 27) { + output.writeMessage(27, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); + } + if (statementCase_ == 28) { + output.writeMessage(28, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); + } + if (statementCase_ == 29) { + output.writeMessage(29, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); + } + if (statementCase_ == 30) { + output.writeMessage(30, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); + } + if (statementCase_ == 31) { + output.writeMessage(31, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); + } + if (statementCase_ == 32) { + output.writeMessage(32, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); + } + if (statementCase_ == 33) { + output.writeMessage(33, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); + } + if (statementCase_ == 34) { + output.writeMessage(34, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); + } + if (statementCase_ == 35) { + output.writeMessage(35, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); + } + if (statementCase_ == 36) { + output.writeMessage(36, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); + } + if (statementCase_ == 37) { + output.writeMessage(37, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); + } + if (statementCase_ == 38) { + output.writeMessage(38, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); + } + if (statementCase_ == 39) { + output.writeMessage(39, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32Size(1, fileId_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(2, location_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeBoolSize(3, synthetic_); + } + if (statementCase_ == 21) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(21, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); + } + if (statementCase_ == 22) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(22, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); + } + if (statementCase_ == 23) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(23, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); + } + if (statementCase_ == 24) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(24, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); + } + if (statementCase_ == 25) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(25, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); + } + if (statementCase_ == 26) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(26, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); + } + if (statementCase_ == 27) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(27, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); + } + if (statementCase_ == 28) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(28, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); + } + if (statementCase_ == 29) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(29, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); + } + if (statementCase_ == 30) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(30, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); + } + if (statementCase_ == 31) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(31, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); + } + if (statementCase_ == 32) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(32, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); + } + if (statementCase_ == 33) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(33, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); + } + if (statementCase_ == 34) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(34, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); + } + if (statementCase_ == 35) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(35, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); + } + if (statementCase_ == 36) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(36, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); + } + if (statementCase_ == 37) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(37, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); + } + if (statementCase_ == 38) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(38, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); + } + if (statementCase_ == 39) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(39, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_); + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom(byte[] data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + byte[] data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseDelimitedFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } /** - * required string message = 1; + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Statement} */ - boolean hasMessage(); - /** - * required string message = 1; - */ - java.lang.String getMessage(); - /** - * required string message = 1; - */ - org.jetbrains.kotlin.protobuf.ByteString - getMessageBytes(); + public static final class Builder extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.Statement) + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.StatementOrBuilder { + // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + fileId_ = 0; + bitField0_ = (bitField0_ & ~0x00000001); + location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000002); + synthetic_ = false; + bitField0_ = (bitField0_ & ~0x00000004); + statementCase_ = 0; + statement_ = null; + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement build() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement buildPartial() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + to_bitField0_ |= 0x00000001; + } + result.fileId_ = fileId_; + if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + to_bitField0_ |= 0x00000002; + } + result.location_ = location_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000004; + } + result.synthetic_ = synthetic_; + if (statementCase_ == 21) { + result.statement_ = statement_; + } + if (statementCase_ == 22) { + result.statement_ = statement_; + } + if (statementCase_ == 23) { + result.statement_ = statement_; + } + if (statementCase_ == 24) { + result.statement_ = statement_; + } + if (statementCase_ == 25) { + result.statement_ = statement_; + } + if (statementCase_ == 26) { + result.statement_ = statement_; + } + if (statementCase_ == 27) { + result.statement_ = statement_; + } + if (statementCase_ == 28) { + result.statement_ = statement_; + } + if (statementCase_ == 29) { + result.statement_ = statement_; + } + if (statementCase_ == 30) { + result.statement_ = statement_; + } + if (statementCase_ == 31) { + result.statement_ = statement_; + } + if (statementCase_ == 32) { + result.statement_ = statement_; + } + if (statementCase_ == 33) { + result.statement_ = statement_; + } + if (statementCase_ == 34) { + result.statement_ = statement_; + } + if (statementCase_ == 35) { + result.statement_ = statement_; + } + if (statementCase_ == 36) { + result.statement_ = statement_; + } + if (statementCase_ == 37) { + result.statement_ = statement_; + } + if (statementCase_ == 38) { + result.statement_ = statement_; + } + if (statementCase_ == 39) { + result.statement_ = statement_; + } + result.bitField0_ = to_bitField0_; + result.statementCase_ = statementCase_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement other) { + if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) return this; + if (other.hasFileId()) { + setFileId(other.getFileId()); + } + if (other.hasLocation()) { + mergeLocation(other.getLocation()); + } + if (other.hasSynthetic()) { + setSynthetic(other.getSynthetic()); + } + switch (other.getStatementCase()) { + case RETURN_STATEMENT: { + mergeReturnStatement(other.getReturnStatement()); + break; + } + case THROW_STATEMENT: { + mergeThrowStatement(other.getThrowStatement()); + break; + } + case BREAK_STATEMENT: { + mergeBreakStatement(other.getBreakStatement()); + break; + } + case CONTINUE_STATEMENT: { + mergeContinueStatement(other.getContinueStatement()); + break; + } + case DEBUGGER: { + mergeDebugger(other.getDebugger()); + break; + } + case EXPRESSION: { + mergeExpression(other.getExpression()); + break; + } + case VARS: { + mergeVars(other.getVars()); + break; + } + case BLOCK: { + mergeBlock(other.getBlock()); + break; + } + case GLOBAL_BLOCK: { + mergeGlobalBlock(other.getGlobalBlock()); + break; + } + case LABEL: { + mergeLabel(other.getLabel()); + break; + } + case IF_STATEMENT: { + mergeIfStatement(other.getIfStatement()); + break; + } + case SWITCH_STATEMENT: { + mergeSwitchStatement(other.getSwitchStatement()); + break; + } + case WHILE_STATEMENT: { + mergeWhileStatement(other.getWhileStatement()); + break; + } + case DO_WHILE_STATEMENT: { + mergeDoWhileStatement(other.getDoWhileStatement()); + break; + } + case FOR_STATEMENT: { + mergeForStatement(other.getForStatement()); + break; + } + case FOR_IN_STATEMENT: { + mergeForInStatement(other.getForInStatement()); + break; + } + case TRY_STATEMENT: { + mergeTryStatement(other.getTryStatement()); + break; + } + case EMPTY: { + mergeEmpty(other.getEmpty()); + break; + } + case SINGLE_LINE_COMMENT: { + mergeSingleLineComment(other.getSingleLineComment()); + break; + } + case STATEMENT_NOT_SET: { + break; + } + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (hasLocation()) { + if (!getLocation().isInitialized()) { + + return false; + } + } + if (hasReturnStatement()) { + if (!getReturnStatement().isInitialized()) { + + return false; + } + } + if (hasThrowStatement()) { + if (!getThrowStatement().isInitialized()) { + + return false; + } + } + if (hasExpression()) { + if (!getExpression().isInitialized()) { + + return false; + } + } + if (hasVars()) { + if (!getVars().isInitialized()) { + + return false; + } + } + if (hasBlock()) { + if (!getBlock().isInitialized()) { + + return false; + } + } + if (hasGlobalBlock()) { + if (!getGlobalBlock().isInitialized()) { + + return false; + } + } + if (hasLabel()) { + if (!getLabel().isInitialized()) { + + return false; + } + } + if (hasIfStatement()) { + if (!getIfStatement().isInitialized()) { + + return false; + } + } + if (hasSwitchStatement()) { + if (!getSwitchStatement().isInitialized()) { + + return false; + } + } + if (hasWhileStatement()) { + if (!getWhileStatement().isInitialized()) { + + return false; + } + } + if (hasDoWhileStatement()) { + if (!getDoWhileStatement().isInitialized()) { + + return false; + } + } + if (hasForStatement()) { + if (!getForStatement().isInitialized()) { + + return false; + } + } + if (hasForInStatement()) { + if (!getForInStatement().isInitialized()) { + + return false; + } + } + if (hasTryStatement()) { + if (!getTryStatement().isInitialized()) { + + return false; + } + } + if (hasSingleLineComment()) { + if (!getSingleLineComment().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int statementCase_ = 0; + private java.lang.Object statement_; + public StatementCase + getStatementCase() { + return StatementCase.valueOf( + statementCase_); + } + + public Builder clearStatement() { + statementCase_ = 0; + statement_ = null; + return this; + } + + private int bitField0_; + + private int fileId_ ; + /** + * optional int32 fileId = 1; + */ + public boolean hasFileId() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional int32 fileId = 1; + */ + public int getFileId() { + return fileId_; + } + /** + * optional int32 fileId = 1; + */ + public Builder setFileId(int value) { + bitField0_ |= 0x00000001; + fileId_ = value; + + return this; + } + /** + * optional int32 fileId = 1; + */ + public Builder clearFileId() { + bitField0_ = (bitField0_ & ~0x00000001); + fileId_ = 0; + + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public boolean hasLocation() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location getLocation() { + return location_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public Builder setLocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location value) { + if (value == null) { + throw new NullPointerException(); + } + location_ = value; + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public Builder setLocation( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.Builder builderForValue) { + location_ = builderForValue.build(); + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public Builder mergeLocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location value) { + if (((bitField0_ & 0x00000002) == 0x00000002) && + location_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance()) { + location_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.newBuilder(location_).mergeFrom(value).buildPartial(); + } else { + location_ = value; + } + + bitField0_ |= 0x00000002; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + */ + public Builder clearLocation() { + location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000002); + return this; + } + + private boolean synthetic_ ; + /** + * optional bool synthetic = 3 [default = false]; + */ + public boolean hasSynthetic() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional bool synthetic = 3 [default = false]; + */ + public boolean getSynthetic() { + return synthetic_; + } + /** + * optional bool synthetic = 3 [default = false]; + */ + public Builder setSynthetic(boolean value) { + bitField0_ |= 0x00000004; + synthetic_ = value; + + return this; + } + /** + * optional bool synthetic = 3 [default = false]; + */ + public Builder clearSynthetic() { + bitField0_ = (bitField0_ & ~0x00000004); + synthetic_ = false; + + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public boolean hasReturnStatement() { + return statementCase_ == 21; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return getReturnStatement() { + if (statementCase_ == 21) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public Builder setReturnStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 21; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public Builder setReturnStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 21; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public Builder mergeReturnStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return value) { + if (statementCase_ == 21 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 21; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; + */ + public Builder clearReturnStatement() { + if (statementCase_ == 21) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public boolean hasThrowStatement() { + return statementCase_ == 22; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw getThrowStatement() { + if (statementCase_ == 22) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public Builder setThrowStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 22; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public Builder setThrowStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 22; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public Builder mergeThrowStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw value) { + if (statementCase_ == 22 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 22; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + */ + public Builder clearThrowStatement() { + if (statementCase_ == 22) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public boolean hasBreakStatement() { + return statementCase_ == 23; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break getBreakStatement() { + if (statementCase_ == 23) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public Builder setBreakStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 23; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public Builder setBreakStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 23; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public Builder mergeBreakStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break value) { + if (statementCase_ == 23 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 23; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; + */ + public Builder clearBreakStatement() { + if (statementCase_ == 23) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public boolean hasContinueStatement() { + return statementCase_ == 24; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue getContinueStatement() { + if (statementCase_ == 24) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public Builder setContinueStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 24; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public Builder setContinueStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 24; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public Builder mergeContinueStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue value) { + if (statementCase_ == 24 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 24; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; + */ + public Builder clearContinueStatement() { + if (statementCase_ == 24) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public boolean hasDebugger() { + return statementCase_ == 25; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger getDebugger() { + if (statementCase_ == 25) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public Builder setDebugger(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 25; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public Builder setDebugger( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 25; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public Builder mergeDebugger(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger value) { + if (statementCase_ == 25 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 25; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; + */ + public Builder clearDebugger() { + if (statementCase_ == 25) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public boolean hasExpression() { + return statementCase_ == 26; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement getExpression() { + if (statementCase_ == 26) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public Builder setExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 26; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public Builder setExpression( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 26; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public Builder mergeExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement value) { + if (statementCase_ == 26 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 26; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; + */ + public Builder clearExpression() { + if (statementCase_ == 26) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public boolean hasVars() { + return statementCase_ == 27; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars getVars() { + if (statementCase_ == 27) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public Builder setVars(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 27; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public Builder setVars( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 27; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public Builder mergeVars(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars value) { + if (statementCase_ == 27 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 27; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; + */ + public Builder clearVars() { + if (statementCase_ == 27) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public boolean hasBlock() { + return statementCase_ == 28; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block getBlock() { + if (statementCase_ == 28) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public Builder setBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 28; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public Builder setBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 28; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public Builder mergeBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block value) { + if (statementCase_ == 28 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 28; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; + */ + public Builder clearBlock() { + if (statementCase_ == 28) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public boolean hasGlobalBlock() { + return statementCase_ == 29; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getGlobalBlock() { + if (statementCase_ == 29) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public Builder setGlobalBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 29; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public Builder setGlobalBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 29; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public Builder mergeGlobalBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (statementCase_ == 29 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 29; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; + */ + public Builder clearGlobalBlock() { + if (statementCase_ == 29) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public boolean hasLabel() { + return statementCase_ == 30; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label getLabel() { + if (statementCase_ == 30) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public Builder setLabel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 30; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public Builder setLabel( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 30; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public Builder mergeLabel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label value) { + if (statementCase_ == 30 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 30; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; + */ + public Builder clearLabel() { + if (statementCase_ == 30) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public boolean hasIfStatement() { + return statementCase_ == 31; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If getIfStatement() { + if (statementCase_ == 31) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public Builder setIfStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 31; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public Builder setIfStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 31; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public Builder mergeIfStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If value) { + if (statementCase_ == 31 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 31; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; + */ + public Builder clearIfStatement() { + if (statementCase_ == 31) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public boolean hasSwitchStatement() { + return statementCase_ == 32; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch getSwitchStatement() { + if (statementCase_ == 32) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public Builder setSwitchStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 32; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public Builder setSwitchStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 32; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public Builder mergeSwitchStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch value) { + if (statementCase_ == 32 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 32; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; + */ + public Builder clearSwitchStatement() { + if (statementCase_ == 32) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public boolean hasWhileStatement() { + return statementCase_ == 33; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While getWhileStatement() { + if (statementCase_ == 33) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public Builder setWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 33; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public Builder setWhileStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 33; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public Builder mergeWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While value) { + if (statementCase_ == 33 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 33; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; + */ + public Builder clearWhileStatement() { + if (statementCase_ == 33) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public boolean hasDoWhileStatement() { + return statementCase_ == 34; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile getDoWhileStatement() { + if (statementCase_ == 34) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public Builder setDoWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 34; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public Builder setDoWhileStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 34; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public Builder mergeDoWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile value) { + if (statementCase_ == 34 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 34; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; + */ + public Builder clearDoWhileStatement() { + if (statementCase_ == 34) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public boolean hasForStatement() { + return statementCase_ == 35; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For getForStatement() { + if (statementCase_ == 35) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public Builder setForStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 35; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public Builder setForStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 35; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public Builder mergeForStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For value) { + if (statementCase_ == 35 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 35; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; + */ + public Builder clearForStatement() { + if (statementCase_ == 35) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public boolean hasForInStatement() { + return statementCase_ == 36; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn getForInStatement() { + if (statementCase_ == 36) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public Builder setForInStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 36; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public Builder setForInStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 36; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public Builder mergeForInStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn value) { + if (statementCase_ == 36 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 36; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; + */ + public Builder clearForInStatement() { + if (statementCase_ == 36) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public boolean hasTryStatement() { + return statementCase_ == 37; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try getTryStatement() { + if (statementCase_ == 37) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public Builder setTryStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 37; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public Builder setTryStatement( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 37; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public Builder mergeTryStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try value) { + if (statementCase_ == 37 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 37; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; + */ + public Builder clearTryStatement() { + if (statementCase_ == 37) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public boolean hasEmpty() { + return statementCase_ == 38; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty getEmpty() { + if (statementCase_ == 38) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public Builder setEmpty(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 38; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public Builder setEmpty( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 38; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public Builder mergeEmpty(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty value) { + if (statementCase_ == 38 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 38; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; + */ + public Builder clearEmpty() { + if (statementCase_ == 38) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public boolean hasSingleLineComment() { + return statementCase_ == 39; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment getSingleLineComment() { + if (statementCase_ == 39) { + return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_; + } + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance(); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public Builder setSingleLineComment(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment value) { + if (value == null) { + throw new NullPointerException(); + } + statement_ = value; + + statementCase_ = 39; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public Builder setSingleLineComment( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.Builder builderForValue) { + statement_ = builderForValue.build(); + + statementCase_ = 39; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public Builder mergeSingleLineComment(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment value) { + if (statementCase_ == 39 && + statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance()) { + statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_) + .mergeFrom(value).buildPartial(); + } else { + statement_ = value; + } + + statementCase_ = 39; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; + */ + public Builder clearSingleLineComment() { + if (statementCase_ == 39) { + statementCase_ = 0; + statement_ = null; + + } + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.Statement) + } + + static { + defaultInstance = new Statement(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Statement) } public interface ReturnOrBuilder extends @@ -27551,325 +30376,49 @@ public final class JsAstProtoBuf { // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Empty) } - public interface FragmentOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.Fragment) + public interface CodeOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.Code) org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + * required string value = 1; */ - java.util.List - getImportedModuleList(); + boolean hasValue(); /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + * required string value = 1; */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index); + java.lang.String getValue(); /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - int getImportedModuleCount(); - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - java.util.List - getImportEntryList(); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - int getImportEntryCount(); - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - boolean hasDeclarationBlock(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock(); - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - boolean hasExportBlock(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock(); - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - boolean hasInitializerBlock(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock(); - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - java.util.List - getNameBindingList(); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - int getNameBindingCount(); - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - java.util.List - getClassModelList(); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - int getClassModelCount(); - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - java.util.List - getModuleExpressionList(); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - int getModuleExpressionCount(); - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - java.util.List - getInlineModuleList(); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - int getInlineModuleCount(); - - /** - * optional string package_fqn = 10; - */ - boolean hasPackageFqn(); - /** - * optional string package_fqn = 10; - */ - java.lang.String getPackageFqn(); - /** - * optional string package_fqn = 10; + * required string value = 1; */ org.jetbrains.kotlin.protobuf.ByteString - getPackageFqnBytes(); - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - boolean hasTestsInvocation(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation(); - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - boolean hasMainInvocation(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation(); - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - java.util.List - getInlinedLocalDeclarationsList(); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - int getInlinedLocalDeclarationsCount(); - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - java.util.List - getIrClassModelList(); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getIrClassModel(int index); - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - int getIrClassModelCount(); - - /** - * optional string dts = 15; - */ - boolean hasDts(); - /** - * optional string dts = 15; - */ - java.lang.String getDts(); - /** - * optional string dts = 15; - */ - org.jetbrains.kotlin.protobuf.ByteString - getDtsBytes(); - - /** - * optional int32 suite_function = 16; - */ - boolean hasSuiteFunction(); - /** - * optional int32 suite_function = 16; - */ - int getSuiteFunction(); - - /** - * repeated int32 definitions = 17; - */ - java.util.List getDefinitionsList(); - /** - * repeated int32 definitions = 17; - */ - int getDefinitionsCount(); - /** - * repeated int32 definitions = 17; - */ - int getDefinitions(int index); + getValueBytes(); } - public interface IrClassModelOrBuilder extends - // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.IrClassModel) - org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { - - /** - * required int32 name_id = 1; - */ - boolean hasNameId(); - /** - * required int32 name_id = 1; - */ - int getNameId(); - - /** - * repeated int32 super_classes = 2; - */ - java.util.List getSuperClassesList(); - /** - * repeated int32 super_classes = 2; - */ - int getSuperClassesCount(); - /** - * repeated int32 super_classes = 2; - */ - int getSuperClasses(int index); - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; - */ - boolean hasPreDeclarationBlock(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPreDeclarationBlock(); - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; - */ - boolean hasPostDeclarationBlock(); - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; - */ - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPostDeclarationBlock(); - } - /** - * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Statement} + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Code} */ - public static final class Statement extends + public static final class Code extends org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.Statement) - StatementOrBuilder { - public static final int FILEID_FIELD_NUMBER = 1; - public static final int LOCATION_FIELD_NUMBER = 2; - public static final int SYNTHETIC_FIELD_NUMBER = 3; - public static final int RETURN_STATEMENT_FIELD_NUMBER = 21; - public static final int THROW_STATEMENT_FIELD_NUMBER = 22; - public static final int BREAK_STATEMENT_FIELD_NUMBER = 23; - public static final int CONTINUE_STATEMENT_FIELD_NUMBER = 24; - public static final int DEBUGGER_FIELD_NUMBER = 25; - public static final int EXPRESSION_FIELD_NUMBER = 26; - public static final int VARS_FIELD_NUMBER = 27; - public static final int BLOCK_FIELD_NUMBER = 28; - public static final int GLOBAL_BLOCK_FIELD_NUMBER = 29; - public static final int LABEL_FIELD_NUMBER = 30;; - public static final int IF_STATEMENT_FIELD_NUMBER = 31; - public static final int SWITCH_STATEMENT_FIELD_NUMBER = 32; - public static final int WHILE_STATEMENT_FIELD_NUMBER = 33; - public static final int DO_WHILE_STATEMENT_FIELD_NUMBER = 34; - public static final int FOR_STATEMENT_FIELD_NUMBER = 35; - public static final int FOR_IN_STATEMENT_FIELD_NUMBER = 36; - public static final int TRY_STATEMENT_FIELD_NUMBER = 37; - public static final int EMPTY_FIELD_NUMBER = 38; - public static final int SINGLE_LINE_COMMENT_FIELD_NUMBER = 39; - private static final Statement defaultInstance; - private static final long serialVersionUID = 0L; - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public Statement parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new Statement(input, extensionRegistry); - } - }; - - static { - defaultInstance = new Statement(true); - defaultInstance.initFields(); - } - - private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; - private int bitField0_; - private int statementCase_ = 0; - private java.lang.Object statement_; - private int fileId_; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location location_; - private boolean synthetic_; - private byte memoizedIsInitialized = -1; - private int memoizedSerializedSize = -1; - - // Use Statement.newBuilder() to construct. - private Statement(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.Code) + CodeOrBuilder { + // Use Code.newBuilder() to construct. + private Code(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } - private Statement(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} - private Statement( + private Code(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} + + private static final Code defaultInstance; + public static Code getDefaultInstance() { + return defaultInstance; + } + + public Code getDefaultInstanceForType() { + return defaultInstance; + } + + private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; + private Code( org.jetbrains.kotlin.protobuf.CodedInputStream input, org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { @@ -27895,274 +30444,10 @@ public final class JsAstProtoBuf { } break; } - case 8: { + case 10: { + org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000001; - fileId_ = input.readInt32(); - break; - } - case 18: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = location_.toBuilder(); - } - location_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(location_); - location_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 24: { - bitField0_ |= 0x00000004; - synthetic_ = input.readBool(); - break; - } - case 170: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.Builder subBuilder = null; - if (statementCase_ == 21) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 21; - break; - } - case 178: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.Builder subBuilder = null; - if (statementCase_ == 22) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 22; - break; - } - case 186: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.Builder subBuilder = null; - if (statementCase_ == 23) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 23; - break; - } - case 194: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.Builder subBuilder = null; - if (statementCase_ == 24) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 24; - break; - } - case 202: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.Builder subBuilder = null; - if (statementCase_ == 25) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 25; - break; - } - case 210: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.Builder subBuilder = null; - if (statementCase_ == 26) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 26; - break; - } - case 218: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.Builder subBuilder = null; - if (statementCase_ == 27) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 27; - break; - } - case 226: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.Builder subBuilder = null; - if (statementCase_ == 28) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 28; - break; - } - case 234: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; - if (statementCase_ == 29) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 29; - break; - } - case 242: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.Builder subBuilder = null; - if (statementCase_ == 30) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 30; - break; - } - case 250: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.Builder subBuilder = null; - if (statementCase_ == 31) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 31; - break; - } - case 258: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.Builder subBuilder = null; - if (statementCase_ == 32) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 32; - break; - } - case 266: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.Builder subBuilder = null; - if (statementCase_ == 33) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 33; - break; - } - case 274: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.Builder subBuilder = null; - if (statementCase_ == 34) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 34; - break; - } - case 282: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.Builder subBuilder = null; - if (statementCase_ == 35) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 35; - break; - } - case 290: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.Builder subBuilder = null; - if (statementCase_ == 36) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 36; - break; - } - case 298: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.Builder subBuilder = null; - if (statementCase_ == 37) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 37; - break; - } - case 306: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.Builder subBuilder = null; - if (statementCase_ == 38) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 38; - break; - } - case 314: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.Builder subBuilder = null; - if (statementCase_ == 39) { - subBuilder = ((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_).toBuilder(); - } - statement_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_); - statement_ = subBuilder.buildPartial(); - } - statementCase_ = 39; + value_ = bs; break; } } @@ -28183,565 +30468,76 @@ public final class JsAstProtoBuf { makeExtensionsImmutable(); } } - - public static Statement getDefaultInstance() { - return defaultInstance; - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - byte[] data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseDelimitedFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - - public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement prototype) { - return newBuilder().mergeFrom(prototype); - } - - public Statement getDefaultInstanceForType() { - return defaultInstance; - } + public static org.jetbrains.kotlin.protobuf.Parser PARSER = + new org.jetbrains.kotlin.protobuf.AbstractParser() { + public Code parsePartialFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return new Code(input, extensionRegistry); + } + }; @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { + public org.jetbrains.kotlin.protobuf.Parser getParserForType() { return PARSER; } - public StatementCase - getStatementCase() { - return StatementCase.valueOf( - statementCase_); - } - + private int bitField0_; + public static final int VALUE_FIELD_NUMBER = 1; + private java.lang.Object value_; /** - * optional int32 fileId = 1; + * required string value = 1; */ - public boolean hasFileId() { + public boolean hasValue() { return ((bitField0_ & 0x00000001) == 0x00000001); } - /** - * optional int32 fileId = 1; + * required string value = 1; */ - public int getFileId() { - return fileId_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public boolean hasLocation() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location getLocation() { - return location_; - } - - /** - * optional bool synthetic = 3 [default = false]; - */ - public boolean hasSynthetic() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional bool synthetic = 3 [default = false]; - */ - public boolean getSynthetic() { - return synthetic_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public boolean hasReturnStatement() { - return statementCase_ == 21; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return getReturnStatement() { - if (statementCase_ == 21) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_; + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance(); } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; + * required string value = 1; */ - public boolean hasThrowStatement() { - return statementCase_ == 22; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw getThrowStatement() { - if (statementCase_ == 22) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_; + public org.jetbrains.kotlin.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public boolean hasBreakStatement() { - return statementCase_ == 23; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break getBreakStatement() { - if (statementCase_ == 23) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public boolean hasContinueStatement() { - return statementCase_ == 24; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue getContinueStatement() { - if (statementCase_ == 24) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public boolean hasDebugger() { - return statementCase_ == 25; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger getDebugger() { - if (statementCase_ == 25) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public boolean hasExpression() { - return statementCase_ == 26; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement getExpression() { - if (statementCase_ == 26) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public boolean hasVars() { - return statementCase_ == 27; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars getVars() { - if (statementCase_ == 27) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public boolean hasBlock() { - return statementCase_ == 28; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block getBlock() { - if (statementCase_ == 28) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public boolean hasGlobalBlock() { - return statementCase_ == 29; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getGlobalBlock() { - if (statementCase_ == 29) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public boolean hasLabel() { - return statementCase_ == 30; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label getLabel() { - if (statementCase_ == 30) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public boolean hasIfStatement() { - return statementCase_ == 31; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If getIfStatement() { - if (statementCase_ == 31) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public boolean hasSwitchStatement() { - return statementCase_ == 32; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch getSwitchStatement() { - if (statementCase_ == 32) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public boolean hasWhileStatement() { - return statementCase_ == 33; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While getWhileStatement() { - if (statementCase_ == 33) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public boolean hasDoWhileStatement() { - return statementCase_ == 34; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile getDoWhileStatement() { - if (statementCase_ == 34) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public boolean hasForStatement() { - return statementCase_ == 35; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For getForStatement() { - if (statementCase_ == 35) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public boolean hasForInStatement() { - return statementCase_ == 36; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn getForInStatement() { - if (statementCase_ == 36) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public boolean hasTryStatement() { - return statementCase_ == 37; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try getTryStatement() { - if (statementCase_ == 37) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public boolean hasEmpty() { - return statementCase_ == 38; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty getEmpty() { - if (statementCase_ == 38) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance(); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; - */ - public boolean hasSingleLineComment() { - return statementCase_ == 39; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment getSingleLineComment() { - if (statementCase_ == 39) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance(); } private void initFields() { - fileId_ = 0; - location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); - synthetic_ = false; + value_ = ""; } - + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; - if (hasLocation()) { - if (!getLocation().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasReturnStatement()) { - if (!getReturnStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasThrowStatement()) { - if (!getThrowStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasExpression()) { - if (!getExpression().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasVars()) { - if (!getVars().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasBlock()) { - if (!getBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasGlobalBlock()) { - if (!getGlobalBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasLabel()) { - if (!getLabel().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasIfStatement()) { - if (!getIfStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasSwitchStatement()) { - if (!getSwitchStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasWhileStatement()) { - if (!getWhileStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasDoWhileStatement()) { - if (!getDoWhileStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasForStatement()) { - if (!getForStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasForInStatement()) { - if (!getForInStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasTryStatement()) { - if (!getTryStatement().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasSingleLineComment()) { - if (!getSingleLineComment().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } + if (!hasValue()) { + memoizedIsInitialized = 0; + return false; } memoizedIsInitialized = 1; return true; @@ -28751,74 +30547,12 @@ public final class JsAstProtoBuf { throws java.io.IOException { getSerializedSize(); if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeInt32(1, fileId_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(2, location_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeBool(3, synthetic_); - } - if (statementCase_ == 21) { - output.writeMessage(21, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); - } - if (statementCase_ == 22) { - output.writeMessage(22, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); - } - if (statementCase_ == 23) { - output.writeMessage(23, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); - } - if (statementCase_ == 24) { - output.writeMessage(24, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); - } - if (statementCase_ == 25) { - output.writeMessage(25, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); - } - if (statementCase_ == 26) { - output.writeMessage(26, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); - } - if (statementCase_ == 27) { - output.writeMessage(27, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); - } - if (statementCase_ == 28) { - output.writeMessage(28, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); - } - if (statementCase_ == 29) { - output.writeMessage(29, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); - } - if (statementCase_ == 30) { - output.writeMessage(30, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); - } - if (statementCase_ == 31) { - output.writeMessage(31, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); - } - if (statementCase_ == 32) { - output.writeMessage(32, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); - } - if (statementCase_ == 33) { - output.writeMessage(33, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); - } - if (statementCase_ == 34) { - output.writeMessage(34, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); - } - if (statementCase_ == 35) { - output.writeMessage(35, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); - } - if (statementCase_ == 36) { - output.writeMessage(36, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); - } - if (statementCase_ == 37) { - output.writeMessage(37, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); - } - if (statementCase_ == 38) { - output.writeMessage(38, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); - } - if (statementCase_ == 39) { - output.writeMessage(39, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_); + output.writeBytes(1, getValueBytes()); } output.writeRawBytes(unknownFields); } + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; @@ -28826,202 +30560,104 @@ public final class JsAstProtoBuf { size = 0; if (((bitField0_ & 0x00000001) == 0x00000001)) { size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeInt32Size(1, fileId_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(2, location_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeBoolSize(3, synthetic_); - } - if (statementCase_ == 21) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(21, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_); - } - if (statementCase_ == 22) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(22, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_); - } - if (statementCase_ == 23) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(23, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_); - } - if (statementCase_ == 24) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(24, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_); - } - if (statementCase_ == 25) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(25, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_); - } - if (statementCase_ == 26) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(26, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_); - } - if (statementCase_ == 27) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(27, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_); - } - if (statementCase_ == 28) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(28, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_); - } - if (statementCase_ == 29) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(29, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_); - } - if (statementCase_ == 30) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(30, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_); - } - if (statementCase_ == 31) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(31, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_); - } - if (statementCase_ == 32) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(32, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_); - } - if (statementCase_ == 33) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(33, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_); - } - if (statementCase_ == 34) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(34, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_); - } - if (statementCase_ == 35) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(35, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_); - } - if (statementCase_ == 36) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(36, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_); - } - if (statementCase_ == 37) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(37, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_); - } - if (statementCase_ == 38) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(38, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_); - } - if (statementCase_ == 39) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(39, (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_); + .computeBytesSize(1, getValueBytes()); } size += unknownFields.size(); memoizedSerializedSize = size; return size; } + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - public Builder newBuilderForType() { return newBuilder(); } - - public Builder toBuilder() { return newBuilder(this); } - -public enum StatementCase - implements org.jetbrains.kotlin.protobuf.Internal.EnumLite { - RETURN_STATEMENT(21), - THROW_STATEMENT(22), - BREAK_STATEMENT(23), - CONTINUE_STATEMENT(24), - DEBUGGER(25), - EXPRESSION(26), - VARS(27), - BLOCK(28), - GLOBAL_BLOCK(29), - LABEL(30), - IF_STATEMENT(31), - SWITCH_STATEMENT(32), - WHILE_STATEMENT(33), - DO_WHILE_STATEMENT(34), - FOR_STATEMENT(35), - FOR_IN_STATEMENT(36), - TRY_STATEMENT(37), - EMPTY(38), - SINGLE_LINE_COMMENT(39), - STATEMENT_NOT_SET(0); - private int value = 0; - private StatementCase(int value) { - this.value = value; - } - public static StatementCase valueOf(int value) { - switch (value) { - case 21: return RETURN_STATEMENT; - case 22: return THROW_STATEMENT; - case 23: return BREAK_STATEMENT; - case 24: return CONTINUE_STATEMENT; - case 25: return DEBUGGER; - case 26: return EXPRESSION; - case 27: return VARS; - case 28: return BLOCK; - case 29: return GLOBAL_BLOCK; - case 30: return LABEL; - case 31: return IF_STATEMENT; - case 32: return SWITCH_STATEMENT; - case 33: return WHILE_STATEMENT; - case 34: return DO_WHILE_STATEMENT; - case 35: return FOR_STATEMENT; - case 36: return FOR_IN_STATEMENT; - case 37: return TRY_STATEMENT; - case 38: return EMPTY; - case 39: return SINGLE_LINE_COMMENT; - case 0: return STATEMENT_NOT_SET; - default: throw new java.lang.IllegalArgumentException( - "Value is undefined for this oneof enum."); - } - } - public int getNumber() { - return this.value; - } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseFrom(byte[] data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseFrom( + byte[] data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseDelimitedFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); } + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + /** - * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Statement} + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Code} */ public static final class Builder extends org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement, Builder> + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code, Builder> implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.Statement) - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.StatementOrBuilder { - private int statementCase_ = 0; - private java.lang.Object statement_; - private int bitField0_; - private int fileId_ ; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); - private boolean synthetic_ ; - - // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder() + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.Code) + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.CodeOrBuilder { + // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code.newBuilder() private Builder() { maybeForceBuilderInitialization(); } + private void maybeForceBuilderInitialization() { + } private static Builder create() { return new Builder(); } - private void maybeForceBuilderInitialization() { - } - public Builder clear() { super.clear(); - fileId_ = 0; + value_ = ""; bitField0_ = (bitField0_ & ~0x00000001); - location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000002); - synthetic_ = false; - bitField0_ = (bitField0_ & ~0x00000004); - statementCase_ = 0; - statement_ = null; return this; } @@ -29029,187 +30665,36 @@ public enum StatementCase return create().mergeFrom(buildPartial()); } - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getDefaultInstanceForType() { - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code.getDefaultInstance(); } - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement build() { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement result = buildPartial(); + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code build() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement buildPartial() { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement(this); + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code buildPartial() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; if (((from_bitField0_ & 0x00000001) == 0x00000001)) { to_bitField0_ |= 0x00000001; } - result.fileId_ = fileId_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { - to_bitField0_ |= 0x00000002; - } - result.location_ = location_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000004; - } - result.synthetic_ = synthetic_; - if (statementCase_ == 21) { - result.statement_ = statement_; - } - if (statementCase_ == 22) { - result.statement_ = statement_; - } - if (statementCase_ == 23) { - result.statement_ = statement_; - } - if (statementCase_ == 24) { - result.statement_ = statement_; - } - if (statementCase_ == 25) { - result.statement_ = statement_; - } - if (statementCase_ == 26) { - result.statement_ = statement_; - } - if (statementCase_ == 27) { - result.statement_ = statement_; - } - if (statementCase_ == 28) { - result.statement_ = statement_; - } - if (statementCase_ == 29) { - result.statement_ = statement_; - } - if (statementCase_ == 30) { - result.statement_ = statement_; - } - if (statementCase_ == 31) { - result.statement_ = statement_; - } - if (statementCase_ == 32) { - result.statement_ = statement_; - } - if (statementCase_ == 33) { - result.statement_ = statement_; - } - if (statementCase_ == 34) { - result.statement_ = statement_; - } - if (statementCase_ == 35) { - result.statement_ = statement_; - } - if (statementCase_ == 36) { - result.statement_ = statement_; - } - if (statementCase_ == 37) { - result.statement_ = statement_; - } - if (statementCase_ == 38) { - result.statement_ = statement_; - } - if (statementCase_ == 39) { - result.statement_ = statement_; - } + result.value_ = value_; result.bitField0_ = to_bitField0_; - result.statementCase_ = statementCase_; return result; } - public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement other) { - if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) return this; - if (other.hasFileId()) { - setFileId(other.getFileId()); - } - if (other.hasLocation()) { - mergeLocation(other.getLocation()); - } - if (other.hasSynthetic()) { - setSynthetic(other.getSynthetic()); - } - switch (other.getStatementCase()) { - case RETURN_STATEMENT: { - mergeReturnStatement(other.getReturnStatement()); - break; - } - case THROW_STATEMENT: { - mergeThrowStatement(other.getThrowStatement()); - break; - } - case BREAK_STATEMENT: { - mergeBreakStatement(other.getBreakStatement()); - break; - } - case CONTINUE_STATEMENT: { - mergeContinueStatement(other.getContinueStatement()); - break; - } - case DEBUGGER: { - mergeDebugger(other.getDebugger()); - break; - } - case EXPRESSION: { - mergeExpression(other.getExpression()); - break; - } - case VARS: { - mergeVars(other.getVars()); - break; - } - case BLOCK: { - mergeBlock(other.getBlock()); - break; - } - case GLOBAL_BLOCK: { - mergeGlobalBlock(other.getGlobalBlock()); - break; - } - case LABEL: { - mergeLabel(other.getLabel()); - break; - } - case IF_STATEMENT: { - mergeIfStatement(other.getIfStatement()); - break; - } - case SWITCH_STATEMENT: { - mergeSwitchStatement(other.getSwitchStatement()); - break; - } - case WHILE_STATEMENT: { - mergeWhileStatement(other.getWhileStatement()); - break; - } - case DO_WHILE_STATEMENT: { - mergeDoWhileStatement(other.getDoWhileStatement()); - break; - } - case FOR_STATEMENT: { - mergeForStatement(other.getForStatement()); - break; - } - case FOR_IN_STATEMENT: { - mergeForInStatement(other.getForInStatement()); - break; - } - case TRY_STATEMENT: { - mergeTryStatement(other.getTryStatement()); - break; - } - case EMPTY: { - mergeEmpty(other.getEmpty()); - break; - } - case SINGLE_LINE_COMMENT: { - mergeSingleLineComment(other.getSingleLineComment()); - break; - } - case STATEMENT_NOT_SET: { - break; - } + public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code other) { + if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code.getDefaultInstance()) return this; + if (other.hasValue()) { + bitField0_ |= 0x00000001; + value_ = other.value_; + } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -29217,101 +30702,9 @@ public enum StatementCase } public final boolean isInitialized() { - if (hasLocation()) { - if (!getLocation().isInitialized()) { - - return false; - } - } - if (hasReturnStatement()) { - if (!getReturnStatement().isInitialized()) { - - return false; - } - } - if (hasThrowStatement()) { - if (!getThrowStatement().isInitialized()) { - - return false; - } - } - if (hasExpression()) { - if (!getExpression().isInitialized()) { - - return false; - } - } - if (hasVars()) { - if (!getVars().isInitialized()) { - - return false; - } - } - if (hasBlock()) { - if (!getBlock().isInitialized()) { - - return false; - } - } - if (hasGlobalBlock()) { - if (!getGlobalBlock().isInitialized()) { - - return false; - } - } - if (hasLabel()) { - if (!getLabel().isInitialized()) { - - return false; - } - } - if (hasIfStatement()) { - if (!getIfStatement().isInitialized()) { - - return false; - } - } - if (hasSwitchStatement()) { - if (!getSwitchStatement().isInitialized()) { - - return false; - } - } - if (hasWhileStatement()) { - if (!getWhileStatement().isInitialized()) { - - return false; - } - } - if (hasDoWhileStatement()) { - if (!getDoWhileStatement().isInitialized()) { - - return false; - } - } - if (hasForStatement()) { - if (!getForStatement().isInitialized()) { - - return false; - } - } - if (hasForInStatement()) { - if (!getForInStatement().isInitialized()) { - - return false; - } - } - if (hasTryStatement()) { - if (!getTryStatement().isInitialized()) { - - return false; - } - } - if (hasSingleLineComment()) { - if (!getSingleLineComment().isInitialized()) { - - return false; - } + if (!hasValue()) { + + return false; } return true; } @@ -29320,11 +30713,11 @@ public enum StatementCase org.jetbrains.kotlin.protobuf.CodedInputStream input, org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement parsedMessage = null; + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement) e.getUnfinishedMessage(); + parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Code) e.getUnfinishedMessage(); throw e; } finally { if (parsedMessage != null) { @@ -29333,1370 +30726,113 @@ public enum StatementCase } return this; } + private int bitField0_; - public StatementCase - getStatementCase() { - return StatementCase.valueOf( - statementCase_); - } - - public Builder clearStatement() { - statementCase_ = 0; - statement_ = null; - return this; - } - + private java.lang.Object value_ = ""; /** - * optional int32 fileId = 1; + * required string value = 1; */ - public boolean hasFileId() { + public boolean hasValue() { return ((bitField0_ & 0x00000001) == 0x00000001); } - /** - * optional int32 fileId = 1; + * required string value = 1; */ - public int getFileId() { - return fileId_; + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + value_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } } - /** - * optional int32 fileId = 1; + * required string value = 1; */ - public Builder setFileId(int value) { - bitField0_ |= 0x00000001; - fileId_ = value; - + public org.jetbrains.kotlin.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } + /** + * required string value = 1; + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + value_ = value; + return this; } - /** - * optional int32 fileId = 1; + * required string value = 1; */ - public Builder clearFileId() { + public Builder clearValue() { bitField0_ = (bitField0_ & ~0x00000001); - fileId_ = 0; - + value_ = getDefaultInstance().getValue(); + return this; } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; + * required string value = 1; */ - public boolean hasLocation() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location getLocation() { - return location_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public Builder setLocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location value) { + public Builder setValueBytes( + org.jetbrains.kotlin.protobuf.ByteString value) { if (value == null) { - throw new NullPointerException(); - } - location_ = value; - - bitField0_ |= 0x00000002; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public Builder setLocation( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.Builder builderForValue) { - location_ = builderForValue.build(); - - bitField0_ |= 0x00000002; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public Builder mergeLocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location value) { - if (((bitField0_ & 0x00000002) == 0x00000002) && - location_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance()) { - location_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.newBuilder(location_).mergeFrom(value).buildPartial(); - } else { - location_ = value; - } - - bitField0_ |= 0x00000002; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Location location = 2; - */ - public Builder clearLocation() { - location_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Location.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000002); - return this; - } - - /** - * optional bool synthetic = 3 [default = false]; - */ - public boolean hasSynthetic() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - /** - * optional bool synthetic = 3 [default = false]; - */ - public boolean getSynthetic() { - return synthetic_; - } - /** - * optional bool synthetic = 3 [default = false]; - */ - public Builder setSynthetic(boolean value) { - bitField0_ |= 0x00000004; - synthetic_ = value; - - return this; - } - /** - * optional bool synthetic = 3 [default = false]; - */ - public Builder clearSynthetic() { - bitField0_ = (bitField0_ & ~0x00000004); - synthetic_ = false; - - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public boolean hasReturnStatement() { - return statementCase_ == 21; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return getReturnStatement() { - if (statementCase_ == 21) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public Builder setReturnStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 21; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public Builder setReturnStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 21; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public Builder mergeReturnStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return value) { - if (statementCase_ == 21 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Return) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 21; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Return return_statement = 21; - */ - public Builder clearReturnStatement() { - if (statementCase_ == 21) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public boolean hasThrowStatement() { - return statementCase_ == 22; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw getThrowStatement() { - if (statementCase_ == 22) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public Builder setThrowStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 22; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public Builder setThrowStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 22; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public Builder mergeThrowStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw value) { - if (statementCase_ == 22 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Throw) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 22; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Throw throw_statement = 22; - */ - public Builder clearThrowStatement() { - if (statementCase_ == 22) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public boolean hasBreakStatement() { - return statementCase_ == 23; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break getBreakStatement() { - if (statementCase_ == 23) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public Builder setBreakStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 23; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public Builder setBreakStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 23; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public Builder mergeBreakStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break value) { - if (statementCase_ == 23 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Break) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 23; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Break break_statement = 23; - */ - public Builder clearBreakStatement() { - if (statementCase_ == 23) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public boolean hasContinueStatement() { - return statementCase_ == 24; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue getContinueStatement() { - if (statementCase_ == 24) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public Builder setContinueStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 24; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public Builder setContinueStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 24; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public Builder mergeContinueStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue value) { - if (statementCase_ == 24 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Continue) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 24; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Continue continue_statement = 24; - */ - public Builder clearContinueStatement() { - if (statementCase_ == 24) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public boolean hasDebugger() { - return statementCase_ == 25; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger getDebugger() { - if (statementCase_ == 25) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public Builder setDebugger(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 25; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public Builder setDebugger( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 25; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public Builder mergeDebugger(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger value) { - if (statementCase_ == 25 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Debugger) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 25; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Debugger debugger = 25; - */ - public Builder clearDebugger() { - if (statementCase_ == 25) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public boolean hasExpression() { - return statementCase_ == 26; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement getExpression() { - if (statementCase_ == 26) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public Builder setExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 26; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public Builder setExpression( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 26; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public Builder mergeExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement value) { - if (statementCase_ == 26 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionStatement) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 26; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ExpressionStatement expression = 26; - */ - public Builder clearExpression() { - if (statementCase_ == 26) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public boolean hasVars() { - return statementCase_ == 27; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars getVars() { - if (statementCase_ == 27) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public Builder setVars(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 27; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public Builder setVars( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 27; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public Builder mergeVars(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars value) { - if (statementCase_ == 27 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Vars) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 27; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Vars vars = 27; - */ - public Builder clearVars() { - if (statementCase_ == 27) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public boolean hasBlock() { - return statementCase_ == 28; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block getBlock() { - if (statementCase_ == 28) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public Builder setBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 28; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public Builder setBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 28; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public Builder mergeBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block value) { - if (statementCase_ == 28 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Block) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 28; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Block block = 28; - */ - public Builder clearBlock() { - if (statementCase_ == 28) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public boolean hasGlobalBlock() { - return statementCase_ == 29; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getGlobalBlock() { - if (statementCase_ == 29) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public Builder setGlobalBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 29; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public Builder setGlobalBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 29; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public Builder mergeGlobalBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (statementCase_ == 29 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 29; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock global_block = 29; - */ - public Builder clearGlobalBlock() { - if (statementCase_ == 29) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public boolean hasLabel() { - return statementCase_ == 30; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label getLabel() { - if (statementCase_ == 30) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public Builder setLabel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 30; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public Builder setLabel( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 30; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public Builder mergeLabel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label value) { - if (statementCase_ == 30 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Label) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 30; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Label label = 30; - */ - public Builder clearLabel() { - if (statementCase_ == 30) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public boolean hasIfStatement() { - return statementCase_ == 31; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If getIfStatement() { - if (statementCase_ == 31) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public Builder setIfStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 31; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public Builder setIfStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 31; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public Builder mergeIfStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If value) { - if (statementCase_ == 31 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.If) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 31; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.If if_statement = 31; - */ - public Builder clearIfStatement() { - if (statementCase_ == 31) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public boolean hasSwitchStatement() { - return statementCase_ == 32; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch getSwitchStatement() { - if (statementCase_ == 32) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public Builder setSwitchStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 32; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public Builder setSwitchStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 32; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public Builder mergeSwitchStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch value) { - if (statementCase_ == 32 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Switch) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 32; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Switch switch_statement = 32; - */ - public Builder clearSwitchStatement() { - if (statementCase_ == 32) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public boolean hasWhileStatement() { - return statementCase_ == 33; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While getWhileStatement() { - if (statementCase_ == 33) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public Builder setWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 33; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public Builder setWhileStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 33; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public Builder mergeWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While value) { - if (statementCase_ == 33 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.While) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 33; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.While while_statement = 33; - */ - public Builder clearWhileStatement() { - if (statementCase_ == 33) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public boolean hasDoWhileStatement() { - return statementCase_ == 34; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile getDoWhileStatement() { - if (statementCase_ == 34) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public Builder setDoWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 34; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public Builder setDoWhileStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 34; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public Builder mergeDoWhileStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile value) { - if (statementCase_ == 34 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.DoWhile) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 34; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.DoWhile do_while_statement = 34; - */ - public Builder clearDoWhileStatement() { - if (statementCase_ == 34) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public boolean hasForStatement() { - return statementCase_ == 35; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For getForStatement() { - if (statementCase_ == 35) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public Builder setForStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 35; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public Builder setForStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 35; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public Builder mergeForStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For value) { - if (statementCase_ == 35 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.For) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 35; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.For for_statement = 35; - */ - public Builder clearForStatement() { - if (statementCase_ == 35) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public boolean hasForInStatement() { - return statementCase_ == 36; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn getForInStatement() { - if (statementCase_ == 36) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public Builder setForInStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 36; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public Builder setForInStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 36; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public Builder mergeForInStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn value) { - if (statementCase_ == 36 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ForIn) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 36; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.ForIn for_in_statement = 36; - */ - public Builder clearForInStatement() { - if (statementCase_ == 36) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public boolean hasTryStatement() { - return statementCase_ == 37; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try getTryStatement() { - if (statementCase_ == 37) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public Builder setTryStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 37; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public Builder setTryStatement( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 37; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public Builder mergeTryStatement(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try value) { - if (statementCase_ == 37 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Try) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 37; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Try try_statement = 37; - */ - public Builder clearTryStatement() { - if (statementCase_ == 37) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public boolean hasEmpty() { - return statementCase_ == 38; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty getEmpty() { - if (statementCase_ == 38) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public Builder setEmpty(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 38; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public Builder setEmpty( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 38; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public Builder mergeEmpty(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty value) { - if (statementCase_ == 38 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Empty) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 38; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Empty empty = 38; - */ - public Builder clearEmpty() { - if (statementCase_ == 38) { - statementCase_ = 0; - statement_ = null; - - } - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; - */ - public boolean hasSingleLineComment() { - return statementCase_ == 39; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment getSingleLineComment() { - if (statementCase_ == 39) { - return (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_; - } - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance(); - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; - */ - public Builder setSingleLineComment(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment value) { - if (value == null) { - throw new NullPointerException(); - } - statement_ = value; - - statementCase_ = 39; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; - */ - public Builder setSingleLineComment( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.Builder builderForValue) { - statement_ = builderForValue.build(); - - statementCase_ = 39; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; - */ - public Builder mergeSingleLineComment(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment value) { - if (statementCase_ == 39 && - statement_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.getDefaultInstance()) { - statement_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.newBuilder((org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment) statement_) - .mergeFrom(value).buildPartial(); - } else { - statement_ = value; - } - - statementCase_ = 39; - return this; - } - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.SingleLineComment single_line_comment = 39; - */ - public Builder clearSingleLineComment() { - if (statementCase_ == 39) { - statementCase_ = 0; - statement_ = null; - - } + throw new NullPointerException(); + } + bitField0_ |= 0x00000001; + value_ = value; + return this; } - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.Statement) + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.Code) } - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Statement) + static { + defaultInstance = new Code(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Code) } + public interface SingleLineCommentOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) + org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { + + /** + * required string message = 1; + */ + boolean hasMessage(); + /** + * required string message = 1; + */ + java.lang.String getMessage(); + /** + * required string message = 1; + */ + org.jetbrains.kotlin.protobuf.ByteString + getMessageBytes(); + } /** * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.SingleLineComment} */ @@ -30704,35 +30840,23 @@ public enum StatementCase org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) SingleLineCommentOrBuilder { - public static final int MESSAGE_FIELD_NUMBER = 1; - private static final SingleLineComment defaultInstance; - private static final long serialVersionUID = 0L; - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public SingleLineComment parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new SingleLineComment(input, extensionRegistry); - } - }; - - static { - defaultInstance = new SingleLineComment(true); - defaultInstance.initFields(); - } - - private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; - private int bitField0_; - private java.lang.Object message_; - private byte memoizedIsInitialized = -1; - private int memoizedSerializedSize = -1; // Use SingleLineComment.newBuilder() to construct. private SingleLineComment(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { super(builder); this.unknownFields = builder.getUnknownFields(); } private SingleLineComment(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} + + private static final SingleLineComment defaultInstance; + public static SingleLineComment getDefaultInstance() { + return defaultInstance; + } + + public SingleLineComment getDefaultInstanceForType() { + return defaultInstance; + } + + private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; private SingleLineComment( org.jetbrains.kotlin.protobuf.CodedInputStream input, org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) @@ -30783,95 +30907,30 @@ public enum StatementCase makeExtensionsImmutable(); } } - - public static SingleLineComment getDefaultInstance() { - return defaultInstance; - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( - byte[] data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseDelimitedFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder() { return Builder.create(); } - - public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment prototype) { - return newBuilder().mergeFrom(prototype); - } - - public SingleLineComment getDefaultInstanceForType() { - return defaultInstance; - } + public static org.jetbrains.kotlin.protobuf.Parser PARSER = + new org.jetbrains.kotlin.protobuf.AbstractParser() { + public SingleLineComment parsePartialFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return new SingleLineComment(input, extensionRegistry); + } + }; @java.lang.Override public org.jetbrains.kotlin.protobuf.Parser getParserForType() { return PARSER; } + private int bitField0_; + public static final int MESSAGE_FIELD_NUMBER = 1; + private java.lang.Object message_; /** * required string message = 1; */ public boolean hasMessage() { return ((bitField0_ & 0x00000001) == 0x00000001); } - /** * required string message = 1; */ @@ -30880,7 +30939,7 @@ public enum StatementCase if (ref instanceof java.lang.String) { return (java.lang.String) ref; } else { - org.jetbrains.kotlin.protobuf.ByteString bs = + org.jetbrains.kotlin.protobuf.ByteString bs = (org.jetbrains.kotlin.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { @@ -30889,7 +30948,6 @@ public enum StatementCase return s; } } - /** * required string message = 1; */ @@ -30897,7 +30955,7 @@ public enum StatementCase getMessageBytes() { java.lang.Object ref = message_; if (ref instanceof java.lang.String) { - org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString b = org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); message_ = b; @@ -30910,7 +30968,7 @@ public enum StatementCase private void initFields() { message_ = ""; } - + private byte memoizedIsInitialized = -1; public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -30933,6 +30991,7 @@ public enum StatementCase output.writeRawBytes(unknownFields); } + private int memoizedSerializedSize = -1; public int getSerializedSize() { int size = memoizedSerializedSize; if (size != -1) return size; @@ -30947,14 +31006,71 @@ public enum StatementCase return size; } + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { return super.writeReplace(); } - public Builder newBuilderForType() { return newBuilder(); } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom(byte[] data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + byte[] data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseDelimitedFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment prototype) { + return newBuilder().mergeFrom(prototype); + } public Builder toBuilder() { return newBuilder(this); } /** @@ -30966,20 +31082,17 @@ public enum StatementCase implements // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineCommentOrBuilder { - private int bitField0_; - private java.lang.Object message_ = ""; // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.SingleLineComment.newBuilder() private Builder() { maybeForceBuilderInitialization(); } + private void maybeForceBuilderInitialization() { + } private static Builder create() { return new Builder(); } - private void maybeForceBuilderInitialization() { - } - public Builder clear() { super.clear(); message_ = ""; @@ -31020,7 +31133,7 @@ public enum StatementCase if (other.hasMessage()) { bitField0_ |= 0x00000001; message_ = other.message_; - + } setUnknownFields( getUnknownFields().concat(other.unknownFields)); @@ -31029,7 +31142,7 @@ public enum StatementCase public final boolean isInitialized() { if (!hasMessage()) { - + return false; } return true; @@ -31052,7 +31165,9 @@ public enum StatementCase } return this; } + private int bitField0_; + private java.lang.Object message_ = ""; /** * required string message = 1; */ @@ -31076,7 +31191,22 @@ public enum StatementCase return (java.lang.String) ref; } } - + /** + * required string message = 1; + */ + public org.jetbrains.kotlin.protobuf.ByteString + getMessageBytes() { + java.lang.Object ref = message_; + if (ref instanceof String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + message_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } /** * required string message = 1; */ @@ -31087,27 +31217,18 @@ public enum StatementCase } bitField0_ |= 0x00000001; message_ = value; - + return this; } - /** * required string message = 1; */ - public org.jetbrains.kotlin.protobuf.ByteString - getMessageBytes() { - java.lang.Object ref = message_; - if (ref instanceof String) { - org.jetbrains.kotlin.protobuf.ByteString b = - org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - message_ = b; - return b; - } else { - return (org.jetbrains.kotlin.protobuf.ByteString) ref; - } + public Builder clearMessage() { + bitField0_ = (bitField0_ & ~0x00000001); + message_ = getDefaultInstance().getMessage(); + + return this; } - /** * required string message = 1; */ @@ -31118,26 +31239,3374 @@ public enum StatementCase } bitField0_ |= 0x00000001; message_ = value; - - return this; - } - - /** - * required string message = 1; - */ - public Builder clearMessage() { - bitField0_ = (bitField0_ & ~0x00000001); - message_ = getDefaultInstance().getMessage(); - + return this; } // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) } + static { + defaultInstance = new SingleLineComment(true); + defaultInstance.initFields(); + } + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.SingleLineComment) } + public interface FragmentOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.Fragment) + org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + java.util.List + getImportedModuleList(); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + int getImportedModuleCount(); + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + java.util.List + getImportEntryList(); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + int getImportEntryCount(); + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + boolean hasDeclarationBlock(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock(); + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + boolean hasExportBlock(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock(); + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + boolean hasInitializerBlock(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock(); + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + java.util.List + getNameBindingList(); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + int getNameBindingCount(); + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + java.util.List + getClassModelList(); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + int getClassModelCount(); + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + java.util.List + getModuleExpressionList(); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + int getModuleExpressionCount(); + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + java.util.List + getInlineModuleList(); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + int getInlineModuleCount(); + + /** + * optional string package_fqn = 10; + */ + boolean hasPackageFqn(); + /** + * optional string package_fqn = 10; + */ + java.lang.String getPackageFqn(); + /** + * optional string package_fqn = 10; + */ + org.jetbrains.kotlin.protobuf.ByteString + getPackageFqnBytes(); + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + boolean hasTestsInvocation(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation(); + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + boolean hasMainInvocation(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation(); + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + java.util.List + getInlinedLocalDeclarationsList(); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + int getInlinedLocalDeclarationsCount(); + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + java.util.List + getIrClassModelList(); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getIrClassModel(int index); + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + int getIrClassModelCount(); + + /** + * optional string dts = 15; + */ + boolean hasDts(); + /** + * optional string dts = 15; + */ + java.lang.String getDts(); + /** + * optional string dts = 15; + */ + org.jetbrains.kotlin.protobuf.ByteString + getDtsBytes(); + + /** + * optional int32 suite_function = 16; + */ + boolean hasSuiteFunction(); + /** + * optional int32 suite_function = 16; + */ + int getSuiteFunction(); + + /** + * repeated int32 definitions = 17; + */ + java.util.List getDefinitionsList(); + /** + * repeated int32 definitions = 17; + */ + int getDefinitionsCount(); + /** + * repeated int32 definitions = 17; + */ + int getDefinitions(int index); + + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + boolean hasPolyfills(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPolyfills(); + } + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Fragment} + */ + public static final class Fragment extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements + // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.Fragment) + FragmentOrBuilder { + // Use Fragment.newBuilder() to construct. + private Fragment(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { + super(builder); + this.unknownFields = builder.getUnknownFields(); + } + private Fragment(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} + + private static final Fragment defaultInstance; + public static Fragment getDefaultInstance() { + return defaultInstance; + } + + public Fragment getDefaultInstanceForType() { + return defaultInstance; + } + + private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; + private Fragment( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + initFields(); + int mutable_bitField0_ = 0; + org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = + org.jetbrains.kotlin.protobuf.ByteString.newOutput(); + org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = + org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( + unknownFieldsOutput, 1); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!parseUnknownField(input, unknownFieldsCodedOutput, + extensionRegistry, tag)) { + done = true; + } + break; + } + case 10: { + if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + importedModule_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + importedModule_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.PARSER, extensionRegistry)); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + importEntry_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000002; + } + importEntry_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.PARSER, extensionRegistry)); + break; + } + case 26: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + subBuilder = declarationBlock_.toBuilder(); + } + declarationBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(declarationBlock_); + declarationBlock_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000001; + break; + } + case 34: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + subBuilder = exportBlock_.toBuilder(); + } + exportBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(exportBlock_); + exportBlock_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000002; + break; + } + case 42: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (((bitField0_ & 0x00000004) == 0x00000004)) { + subBuilder = initializerBlock_.toBuilder(); + } + initializerBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(initializerBlock_); + initializerBlock_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000004; + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + nameBinding_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000020; + } + nameBinding_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.PARSER, extensionRegistry)); + break; + } + case 58: { + if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + classModel_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000040; + } + classModel_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.PARSER, extensionRegistry)); + break; + } + case 66: { + if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + moduleExpression_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000080; + } + moduleExpression_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.PARSER, extensionRegistry)); + break; + } + case 74: { + if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + inlineModule_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000100; + } + inlineModule_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.PARSER, extensionRegistry)); + break; + } + case 82: { + org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000008; + packageFqn_ = bs; + break; + } + case 90: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder subBuilder = null; + if (((bitField0_ & 0x00000010) == 0x00000010)) { + subBuilder = testsInvocation_.toBuilder(); + } + testsInvocation_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(testsInvocation_); + testsInvocation_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000010; + break; + } + case 98: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder subBuilder = null; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + subBuilder = mainInvocation_.toBuilder(); + } + mainInvocation_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(mainInvocation_); + mainInvocation_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000020; + break; + } + case 106: { + if (!((mutable_bitField0_ & 0x00001000) == 0x00001000)) { + inlinedLocalDeclarations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00001000; + } + inlinedLocalDeclarations_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.PARSER, extensionRegistry)); + break; + } + case 114: { + if (!((mutable_bitField0_ & 0x00002000) == 0x00002000)) { + irClassModel_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00002000; + } + irClassModel_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.PARSER, extensionRegistry)); + break; + } + case 122: { + org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00000040; + dts_ = bs; + break; + } + case 128: { + bitField0_ |= 0x00000080; + suiteFunction_ = input.readInt32(); + break; + } + case 136: { + if (!((mutable_bitField0_ & 0x00010000) == 0x00010000)) { + definitions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00010000; + } + definitions_.add(input.readInt32()); + break; + } + case 138: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00010000) == 0x00010000) && input.getBytesUntilLimit() > 0) { + definitions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00010000; + } + while (input.getBytesUntilLimit() > 0) { + definitions_.add(input.readInt32()); + } + input.popLimit(limit); + break; + } + case 146: { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + subBuilder = polyfills_.toBuilder(); + } + polyfills_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(polyfills_); + polyfills_ = subBuilder.buildPartial(); + } + bitField0_ |= 0x00000100; + break; + } + } + } + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( + e.getMessage()).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { + importedModule_ = java.util.Collections.unmodifiableList(importedModule_); + } + if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { + importEntry_ = java.util.Collections.unmodifiableList(importEntry_); + } + if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { + nameBinding_ = java.util.Collections.unmodifiableList(nameBinding_); + } + if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { + classModel_ = java.util.Collections.unmodifiableList(classModel_); + } + if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { + moduleExpression_ = java.util.Collections.unmodifiableList(moduleExpression_); + } + if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { + inlineModule_ = java.util.Collections.unmodifiableList(inlineModule_); + } + if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) { + inlinedLocalDeclarations_ = java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); + } + if (((mutable_bitField0_ & 0x00002000) == 0x00002000)) { + irClassModel_ = java.util.Collections.unmodifiableList(irClassModel_); + } + if (((mutable_bitField0_ & 0x00010000) == 0x00010000)) { + definitions_ = java.util.Collections.unmodifiableList(definitions_); + } + try { + unknownFieldsCodedOutput.flush(); + } catch (java.io.IOException e) { + // Should not happen + } finally { + unknownFields = unknownFieldsOutput.toByteString(); + } + makeExtensionsImmutable(); + } + } + public static org.jetbrains.kotlin.protobuf.Parser PARSER = + new org.jetbrains.kotlin.protobuf.AbstractParser() { + public Fragment parsePartialFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return new Fragment(input, extensionRegistry); + } + }; + + @java.lang.Override + public org.jetbrains.kotlin.protobuf.Parser getParserForType() { + return PARSER; + } + + private int bitField0_; + public static final int IMPORTED_MODULE_FIELD_NUMBER = 1; + private java.util.List importedModule_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public java.util.List getImportedModuleList() { + return importedModule_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public java.util.List + getImportedModuleOrBuilderList() { + return importedModule_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public int getImportedModuleCount() { + return importedModule_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index) { + return importedModule_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModuleOrBuilder getImportedModuleOrBuilder( + int index) { + return importedModule_.get(index); + } + + public static final int IMPORT_ENTRY_FIELD_NUMBER = 2; + private java.util.List importEntry_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public java.util.List getImportEntryList() { + return importEntry_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public java.util.List + getImportEntryOrBuilderList() { + return importEntry_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public int getImportEntryCount() { + return importEntry_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index) { + return importEntry_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportOrBuilder getImportEntryOrBuilder( + int index) { + return importEntry_.get(index); + } + + public static final int DECLARATION_BLOCK_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock declarationBlock_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public boolean hasDeclarationBlock() { + return ((bitField0_ & 0x00000001) == 0x00000001); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock() { + return declarationBlock_; + } + + public static final int EXPORT_BLOCK_FIELD_NUMBER = 4; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock exportBlock_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public boolean hasExportBlock() { + return ((bitField0_ & 0x00000002) == 0x00000002); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock() { + return exportBlock_; + } + + public static final int INITIALIZER_BLOCK_FIELD_NUMBER = 5; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock initializerBlock_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public boolean hasInitializerBlock() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock() { + return initializerBlock_; + } + + public static final int NAME_BINDING_FIELD_NUMBER = 6; + private java.util.List nameBinding_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public java.util.List getNameBindingList() { + return nameBinding_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public java.util.List + getNameBindingOrBuilderList() { + return nameBinding_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public int getNameBindingCount() { + return nameBinding_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index) { + return nameBinding_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBindingOrBuilder getNameBindingOrBuilder( + int index) { + return nameBinding_.get(index); + } + + public static final int CLASS_MODEL_FIELD_NUMBER = 7; + private java.util.List classModel_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public java.util.List getClassModelList() { + return classModel_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public java.util.List + getClassModelOrBuilderList() { + return classModel_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public int getClassModelCount() { + return classModel_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index) { + return classModel_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModelOrBuilder getClassModelOrBuilder( + int index) { + return classModel_.get(index); + } + + public static final int MODULE_EXPRESSION_FIELD_NUMBER = 8; + private java.util.List moduleExpression_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public java.util.List getModuleExpressionList() { + return moduleExpression_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public java.util.List + getModuleExpressionOrBuilderList() { + return moduleExpression_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public int getModuleExpressionCount() { + return moduleExpression_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index) { + return moduleExpression_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionOrBuilder getModuleExpressionOrBuilder( + int index) { + return moduleExpression_.get(index); + } + + public static final int INLINE_MODULE_FIELD_NUMBER = 9; + private java.util.List inlineModule_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public java.util.List getInlineModuleList() { + return inlineModule_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public java.util.List + getInlineModuleOrBuilderList() { + return inlineModule_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public int getInlineModuleCount() { + return inlineModule_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index) { + return inlineModule_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModuleOrBuilder getInlineModuleOrBuilder( + int index) { + return inlineModule_.get(index); + } + + public static final int PACKAGE_FQN_FIELD_NUMBER = 10; + private java.lang.Object packageFqn_; + /** + * optional string package_fqn = 10; + */ + public boolean hasPackageFqn() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional string package_fqn = 10; + */ + public java.lang.String getPackageFqn() { + java.lang.Object ref = packageFqn_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + packageFqn_ = s; + } + return s; + } + } + /** + * optional string package_fqn = 10; + */ + public org.jetbrains.kotlin.protobuf.ByteString + getPackageFqnBytes() { + java.lang.Object ref = packageFqn_; + if (ref instanceof java.lang.String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + packageFqn_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } + + public static final int TESTS_INVOCATION_FIELD_NUMBER = 11; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement testsInvocation_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public boolean hasTestsInvocation() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation() { + return testsInvocation_; + } + + public static final int MAIN_INVOCATION_FIELD_NUMBER = 12; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement mainInvocation_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public boolean hasMainInvocation() { + return ((bitField0_ & 0x00000020) == 0x00000020); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation() { + return mainInvocation_; + } + + public static final int INLINED_LOCAL_DECLARATIONS_FIELD_NUMBER = 13; + private java.util.List inlinedLocalDeclarations_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public java.util.List getInlinedLocalDeclarationsList() { + return inlinedLocalDeclarations_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public java.util.List + getInlinedLocalDeclarationsOrBuilderList() { + return inlinedLocalDeclarations_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public int getInlinedLocalDeclarationsCount() { + return inlinedLocalDeclarations_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index) { + return inlinedLocalDeclarations_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarationsOrBuilder getInlinedLocalDeclarationsOrBuilder( + int index) { + return inlinedLocalDeclarations_.get(index); + } + + public static final int IR_CLASS_MODEL_FIELD_NUMBER = 14; + private java.util.List irClassModel_; + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public java.util.List getIrClassModelList() { + return irClassModel_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public java.util.List + getIrClassModelOrBuilderList() { + return irClassModel_; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public int getIrClassModelCount() { + return irClassModel_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getIrClassModel(int index) { + return irClassModel_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModelOrBuilder getIrClassModelOrBuilder( + int index) { + return irClassModel_.get(index); + } + + public static final int DTS_FIELD_NUMBER = 15; + private java.lang.Object dts_; + /** + * optional string dts = 15; + */ + public boolean hasDts() { + return ((bitField0_ & 0x00000040) == 0x00000040); + } + /** + * optional string dts = 15; + */ + public java.lang.String getDts() { + java.lang.Object ref = dts_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + dts_ = s; + } + return s; + } + } + /** + * optional string dts = 15; + */ + public org.jetbrains.kotlin.protobuf.ByteString + getDtsBytes() { + java.lang.Object ref = dts_; + if (ref instanceof java.lang.String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dts_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } + + public static final int SUITE_FUNCTION_FIELD_NUMBER = 16; + private int suiteFunction_; + /** + * optional int32 suite_function = 16; + */ + public boolean hasSuiteFunction() { + return ((bitField0_ & 0x00000080) == 0x00000080); + } + /** + * optional int32 suite_function = 16; + */ + public int getSuiteFunction() { + return suiteFunction_; + } + + public static final int DEFINITIONS_FIELD_NUMBER = 17; + private java.util.List definitions_; + /** + * repeated int32 definitions = 17; + */ + public java.util.List + getDefinitionsList() { + return definitions_; + } + /** + * repeated int32 definitions = 17; + */ + public int getDefinitionsCount() { + return definitions_.size(); + } + /** + * repeated int32 definitions = 17; + */ + public int getDefinitions(int index) { + return definitions_.get(index); + } + + public static final int POLYFILLS_FIELD_NUMBER = 18; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock polyfills_; + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + public boolean hasPolyfills() { + return ((bitField0_ & 0x00000100) == 0x00000100); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPolyfills() { + return polyfills_; + } + + private void initFields() { + importedModule_ = java.util.Collections.emptyList(); + importEntry_ = java.util.Collections.emptyList(); + declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + nameBinding_ = java.util.Collections.emptyList(); + classModel_ = java.util.Collections.emptyList(); + moduleExpression_ = java.util.Collections.emptyList(); + inlineModule_ = java.util.Collections.emptyList(); + packageFqn_ = ""; + testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + inlinedLocalDeclarations_ = java.util.Collections.emptyList(); + irClassModel_ = java.util.Collections.emptyList(); + dts_ = ""; + suiteFunction_ = 0; + definitions_ = java.util.Collections.emptyList(); + polyfills_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + } + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + for (int i = 0; i < getImportedModuleCount(); i++) { + if (!getImportedModule(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getImportEntryCount(); i++) { + if (!getImportEntry(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasDeclarationBlock()) { + if (!getDeclarationBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasExportBlock()) { + if (!getExportBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasInitializerBlock()) { + if (!getInitializerBlock().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getNameBindingCount(); i++) { + if (!getNameBinding(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getClassModelCount(); i++) { + if (!getClassModel(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getModuleExpressionCount(); i++) { + if (!getModuleExpression(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getInlineModuleCount(); i++) { + if (!getInlineModule(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasTestsInvocation()) { + if (!getTestsInvocation().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasMainInvocation()) { + if (!getMainInvocation().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getInlinedLocalDeclarationsCount(); i++) { + if (!getInlinedLocalDeclarations(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + for (int i = 0; i < getIrClassModelCount(); i++) { + if (!getIrClassModel(i).isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + if (hasPolyfills()) { + if (!getPolyfills().isInitialized()) { + memoizedIsInitialized = 0; + return false; + } + } + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + for (int i = 0; i < importedModule_.size(); i++) { + output.writeMessage(1, importedModule_.get(i)); + } + for (int i = 0; i < importEntry_.size(); i++) { + output.writeMessage(2, importEntry_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + output.writeMessage(3, declarationBlock_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + output.writeMessage(4, exportBlock_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + output.writeMessage(5, initializerBlock_); + } + for (int i = 0; i < nameBinding_.size(); i++) { + output.writeMessage(6, nameBinding_.get(i)); + } + for (int i = 0; i < classModel_.size(); i++) { + output.writeMessage(7, classModel_.get(i)); + } + for (int i = 0; i < moduleExpression_.size(); i++) { + output.writeMessage(8, moduleExpression_.get(i)); + } + for (int i = 0; i < inlineModule_.size(); i++) { + output.writeMessage(9, inlineModule_.get(i)); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + output.writeBytes(10, getPackageFqnBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + output.writeMessage(11, testsInvocation_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + output.writeMessage(12, mainInvocation_); + } + for (int i = 0; i < inlinedLocalDeclarations_.size(); i++) { + output.writeMessage(13, inlinedLocalDeclarations_.get(i)); + } + for (int i = 0; i < irClassModel_.size(); i++) { + output.writeMessage(14, irClassModel_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + output.writeBytes(15, getDtsBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + output.writeInt32(16, suiteFunction_); + } + for (int i = 0; i < definitions_.size(); i++) { + output.writeInt32(17, definitions_.get(i)); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + output.writeMessage(18, polyfills_); + } + output.writeRawBytes(unknownFields); + } + + private int memoizedSerializedSize = -1; + public int getSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < importedModule_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(1, importedModule_.get(i)); + } + for (int i = 0; i < importEntry_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(2, importEntry_.get(i)); + } + if (((bitField0_ & 0x00000001) == 0x00000001)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(3, declarationBlock_); + } + if (((bitField0_ & 0x00000002) == 0x00000002)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(4, exportBlock_); + } + if (((bitField0_ & 0x00000004) == 0x00000004)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(5, initializerBlock_); + } + for (int i = 0; i < nameBinding_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(6, nameBinding_.get(i)); + } + for (int i = 0; i < classModel_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(7, classModel_.get(i)); + } + for (int i = 0; i < moduleExpression_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(8, moduleExpression_.get(i)); + } + for (int i = 0; i < inlineModule_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(9, inlineModule_.get(i)); + } + if (((bitField0_ & 0x00000008) == 0x00000008)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeBytesSize(10, getPackageFqnBytes()); + } + if (((bitField0_ & 0x00000010) == 0x00000010)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(11, testsInvocation_); + } + if (((bitField0_ & 0x00000020) == 0x00000020)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(12, mainInvocation_); + } + for (int i = 0; i < inlinedLocalDeclarations_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(13, inlinedLocalDeclarations_.get(i)); + } + for (int i = 0; i < irClassModel_.size(); i++) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(14, irClassModel_.get(i)); + } + if (((bitField0_ & 0x00000040) == 0x00000040)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeBytesSize(15, getDtsBytes()); + } + if (((bitField0_ & 0x00000080) == 0x00000080)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32Size(16, suiteFunction_); + } + { + int dataSize = 0; + for (int i = 0; i < definitions_.size(); i++) { + dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeInt32SizeNoTag(definitions_.get(i)); + } + size += dataSize; + size += 2 * getDefinitionsList().size(); + } + if (((bitField0_ & 0x00000100) == 0x00000100)) { + size += org.jetbrains.kotlin.protobuf.CodedOutputStream + .computeMessageSize(18, polyfills_); + } + size += unknownFields.size(); + memoizedSerializedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + protected java.lang.Object writeReplace() + throws java.io.ObjectStreamException { + return super.writeReplace(); + } + + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + org.jetbrains.kotlin.protobuf.ByteString data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom(byte[] data) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + byte[] data, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseDelimitedFrom( + java.io.InputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseDelimitedFrom(input, extensionRegistry); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input) + throws java.io.IOException { + return PARSER.parseFrom(input); + } + public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return PARSER.parseFrom(input, extensionRegistry); + } + + public static Builder newBuilder() { return Builder.create(); } + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment prototype) { + return newBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { return newBuilder(this); } + + /** + * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Fragment} + */ + public static final class Builder extends + org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment, Builder> + implements + // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.Fragment) + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.FragmentOrBuilder { + // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private void maybeForceBuilderInitialization() { + } + private static Builder create() { + return new Builder(); + } + + public Builder clear() { + super.clear(); + importedModule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + importEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000004); + exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000008); + initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000010); + nameBinding_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + classModel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + moduleExpression_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + inlineModule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + packageFqn_ = ""; + bitField0_ = (bitField0_ & ~0x00000200); + testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000400); + mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00000800); + inlinedLocalDeclarations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + irClassModel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + dts_ = ""; + bitField0_ = (bitField0_ & ~0x00004000); + suiteFunction_ = 0; + bitField0_ = (bitField0_ & ~0x00008000); + definitions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00010000); + polyfills_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + bitField0_ = (bitField0_ & ~0x00020000); + return this; + } + + public Builder clone() { + return create().mergeFrom(buildPartial()); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment getDefaultInstanceForType() { + return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.getDefaultInstance(); + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment build() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment buildPartial() { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) == 0x00000001)) { + importedModule_ = java.util.Collections.unmodifiableList(importedModule_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.importedModule_ = importedModule_; + if (((bitField0_ & 0x00000002) == 0x00000002)) { + importEntry_ = java.util.Collections.unmodifiableList(importEntry_); + bitField0_ = (bitField0_ & ~0x00000002); + } + result.importEntry_ = importEntry_; + if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + to_bitField0_ |= 0x00000001; + } + result.declarationBlock_ = declarationBlock_; + if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + to_bitField0_ |= 0x00000002; + } + result.exportBlock_ = exportBlock_; + if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + to_bitField0_ |= 0x00000004; + } + result.initializerBlock_ = initializerBlock_; + if (((bitField0_ & 0x00000020) == 0x00000020)) { + nameBinding_ = java.util.Collections.unmodifiableList(nameBinding_); + bitField0_ = (bitField0_ & ~0x00000020); + } + result.nameBinding_ = nameBinding_; + if (((bitField0_ & 0x00000040) == 0x00000040)) { + classModel_ = java.util.Collections.unmodifiableList(classModel_); + bitField0_ = (bitField0_ & ~0x00000040); + } + result.classModel_ = classModel_; + if (((bitField0_ & 0x00000080) == 0x00000080)) { + moduleExpression_ = java.util.Collections.unmodifiableList(moduleExpression_); + bitField0_ = (bitField0_ & ~0x00000080); + } + result.moduleExpression_ = moduleExpression_; + if (((bitField0_ & 0x00000100) == 0x00000100)) { + inlineModule_ = java.util.Collections.unmodifiableList(inlineModule_); + bitField0_ = (bitField0_ & ~0x00000100); + } + result.inlineModule_ = inlineModule_; + if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + to_bitField0_ |= 0x00000008; + } + result.packageFqn_ = packageFqn_; + if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + to_bitField0_ |= 0x00000010; + } + result.testsInvocation_ = testsInvocation_; + if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + to_bitField0_ |= 0x00000020; + } + result.mainInvocation_ = mainInvocation_; + if (((bitField0_ & 0x00001000) == 0x00001000)) { + inlinedLocalDeclarations_ = java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); + bitField0_ = (bitField0_ & ~0x00001000); + } + result.inlinedLocalDeclarations_ = inlinedLocalDeclarations_; + if (((bitField0_ & 0x00002000) == 0x00002000)) { + irClassModel_ = java.util.Collections.unmodifiableList(irClassModel_); + bitField0_ = (bitField0_ & ~0x00002000); + } + result.irClassModel_ = irClassModel_; + if (((from_bitField0_ & 0x00004000) == 0x00004000)) { + to_bitField0_ |= 0x00000040; + } + result.dts_ = dts_; + if (((from_bitField0_ & 0x00008000) == 0x00008000)) { + to_bitField0_ |= 0x00000080; + } + result.suiteFunction_ = suiteFunction_; + if (((bitField0_ & 0x00010000) == 0x00010000)) { + definitions_ = java.util.Collections.unmodifiableList(definitions_); + bitField0_ = (bitField0_ & ~0x00010000); + } + result.definitions_ = definitions_; + if (((from_bitField0_ & 0x00020000) == 0x00020000)) { + to_bitField0_ |= 0x00000100; + } + result.polyfills_ = polyfills_; + result.bitField0_ = to_bitField0_; + return result; + } + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment other) { + if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.getDefaultInstance()) return this; + if (!other.importedModule_.isEmpty()) { + if (importedModule_.isEmpty()) { + importedModule_ = other.importedModule_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureImportedModuleIsMutable(); + importedModule_.addAll(other.importedModule_); + } + + } + if (!other.importEntry_.isEmpty()) { + if (importEntry_.isEmpty()) { + importEntry_ = other.importEntry_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureImportEntryIsMutable(); + importEntry_.addAll(other.importEntry_); + } + + } + if (other.hasDeclarationBlock()) { + mergeDeclarationBlock(other.getDeclarationBlock()); + } + if (other.hasExportBlock()) { + mergeExportBlock(other.getExportBlock()); + } + if (other.hasInitializerBlock()) { + mergeInitializerBlock(other.getInitializerBlock()); + } + if (!other.nameBinding_.isEmpty()) { + if (nameBinding_.isEmpty()) { + nameBinding_ = other.nameBinding_; + bitField0_ = (bitField0_ & ~0x00000020); + } else { + ensureNameBindingIsMutable(); + nameBinding_.addAll(other.nameBinding_); + } + + } + if (!other.classModel_.isEmpty()) { + if (classModel_.isEmpty()) { + classModel_ = other.classModel_; + bitField0_ = (bitField0_ & ~0x00000040); + } else { + ensureClassModelIsMutable(); + classModel_.addAll(other.classModel_); + } + + } + if (!other.moduleExpression_.isEmpty()) { + if (moduleExpression_.isEmpty()) { + moduleExpression_ = other.moduleExpression_; + bitField0_ = (bitField0_ & ~0x00000080); + } else { + ensureModuleExpressionIsMutable(); + moduleExpression_.addAll(other.moduleExpression_); + } + + } + if (!other.inlineModule_.isEmpty()) { + if (inlineModule_.isEmpty()) { + inlineModule_ = other.inlineModule_; + bitField0_ = (bitField0_ & ~0x00000100); + } else { + ensureInlineModuleIsMutable(); + inlineModule_.addAll(other.inlineModule_); + } + + } + if (other.hasPackageFqn()) { + bitField0_ |= 0x00000200; + packageFqn_ = other.packageFqn_; + + } + if (other.hasTestsInvocation()) { + mergeTestsInvocation(other.getTestsInvocation()); + } + if (other.hasMainInvocation()) { + mergeMainInvocation(other.getMainInvocation()); + } + if (!other.inlinedLocalDeclarations_.isEmpty()) { + if (inlinedLocalDeclarations_.isEmpty()) { + inlinedLocalDeclarations_ = other.inlinedLocalDeclarations_; + bitField0_ = (bitField0_ & ~0x00001000); + } else { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.addAll(other.inlinedLocalDeclarations_); + } + + } + if (!other.irClassModel_.isEmpty()) { + if (irClassModel_.isEmpty()) { + irClassModel_ = other.irClassModel_; + bitField0_ = (bitField0_ & ~0x00002000); + } else { + ensureIrClassModelIsMutable(); + irClassModel_.addAll(other.irClassModel_); + } + + } + if (other.hasDts()) { + bitField0_ |= 0x00004000; + dts_ = other.dts_; + + } + if (other.hasSuiteFunction()) { + setSuiteFunction(other.getSuiteFunction()); + } + if (!other.definitions_.isEmpty()) { + if (definitions_.isEmpty()) { + definitions_ = other.definitions_; + bitField0_ = (bitField0_ & ~0x00010000); + } else { + ensureDefinitionsIsMutable(); + definitions_.addAll(other.definitions_); + } + + } + if (other.hasPolyfills()) { + mergePolyfills(other.getPolyfills()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + for (int i = 0; i < getImportedModuleCount(); i++) { + if (!getImportedModule(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getImportEntryCount(); i++) { + if (!getImportEntry(i).isInitialized()) { + + return false; + } + } + if (hasDeclarationBlock()) { + if (!getDeclarationBlock().isInitialized()) { + + return false; + } + } + if (hasExportBlock()) { + if (!getExportBlock().isInitialized()) { + + return false; + } + } + if (hasInitializerBlock()) { + if (!getInitializerBlock().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getNameBindingCount(); i++) { + if (!getNameBinding(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getClassModelCount(); i++) { + if (!getClassModel(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getModuleExpressionCount(); i++) { + if (!getModuleExpression(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getInlineModuleCount(); i++) { + if (!getInlineModule(i).isInitialized()) { + + return false; + } + } + if (hasTestsInvocation()) { + if (!getTestsInvocation().isInitialized()) { + + return false; + } + } + if (hasMainInvocation()) { + if (!getMainInvocation().isInitialized()) { + + return false; + } + } + for (int i = 0; i < getInlinedLocalDeclarationsCount(); i++) { + if (!getInlinedLocalDeclarations(i).isInitialized()) { + + return false; + } + } + for (int i = 0; i < getIrClassModelCount(); i++) { + if (!getIrClassModel(i).isInitialized()) { + + return false; + } + } + if (hasPolyfills()) { + if (!getPolyfills().isInitialized()) { + + return false; + } + } + return true; + } + + public Builder mergeFrom( + org.jetbrains.kotlin.protobuf.CodedInputStream input, + org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment) e.getUnfinishedMessage(); + throw e; + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List importedModule_ = + java.util.Collections.emptyList(); + private void ensureImportedModuleIsMutable() { + if (!((bitField0_ & 0x00000001) == 0x00000001)) { + importedModule_ = new java.util.ArrayList(importedModule_); + bitField0_ |= 0x00000001; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public java.util.List getImportedModuleList() { + return java.util.Collections.unmodifiableList(importedModule_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public int getImportedModuleCount() { + return importedModule_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index) { + return importedModule_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder setImportedModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportedModuleIsMutable(); + importedModule_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder setImportedModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { + ensureImportedModuleIsMutable(); + importedModule_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addImportedModule(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportedModuleIsMutable(); + importedModule_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addImportedModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportedModuleIsMutable(); + importedModule_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addImportedModule( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { + ensureImportedModuleIsMutable(); + importedModule_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addImportedModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { + ensureImportedModuleIsMutable(); + importedModule_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder addAllImportedModule( + java.lang.Iterable values) { + ensureImportedModuleIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, importedModule_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder clearImportedModule() { + importedModule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + */ + public Builder removeImportedModule(int index) { + ensureImportedModuleIsMutable(); + importedModule_.remove(index); + + return this; + } + + private java.util.List importEntry_ = + java.util.Collections.emptyList(); + private void ensureImportEntryIsMutable() { + if (!((bitField0_ & 0x00000002) == 0x00000002)) { + importEntry_ = new java.util.ArrayList(importEntry_); + bitField0_ |= 0x00000002; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public java.util.List getImportEntryList() { + return java.util.Collections.unmodifiableList(importEntry_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public int getImportEntryCount() { + return importEntry_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index) { + return importEntry_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder setImportEntry( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportEntryIsMutable(); + importEntry_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder setImportEntry( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { + ensureImportEntryIsMutable(); + importEntry_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addImportEntry(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportEntryIsMutable(); + importEntry_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addImportEntry( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { + if (value == null) { + throw new NullPointerException(); + } + ensureImportEntryIsMutable(); + importEntry_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addImportEntry( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { + ensureImportEntryIsMutable(); + importEntry_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addImportEntry( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { + ensureImportEntryIsMutable(); + importEntry_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder addAllImportEntry( + java.lang.Iterable values) { + ensureImportEntryIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, importEntry_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder clearImportEntry() { + importEntry_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; + */ + public Builder removeImportEntry(int index) { + ensureImportEntryIsMutable(); + importEntry_.remove(index); + + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public boolean hasDeclarationBlock() { + return ((bitField0_ & 0x00000004) == 0x00000004); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock() { + return declarationBlock_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public Builder setDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + declarationBlock_ = value; + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public Builder setDeclarationBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + declarationBlock_ = builderForValue.build(); + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public Builder mergeDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (((bitField0_ & 0x00000004) == 0x00000004) && + declarationBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + declarationBlock_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(declarationBlock_).mergeFrom(value).buildPartial(); + } else { + declarationBlock_ = value; + } + + bitField0_ |= 0x00000004; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; + */ + public Builder clearDeclarationBlock() { + declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000004); + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public boolean hasExportBlock() { + return ((bitField0_ & 0x00000008) == 0x00000008); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock() { + return exportBlock_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public Builder setExportBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + exportBlock_ = value; + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public Builder setExportBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + exportBlock_ = builderForValue.build(); + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public Builder mergeExportBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (((bitField0_ & 0x00000008) == 0x00000008) && + exportBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + exportBlock_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(exportBlock_).mergeFrom(value).buildPartial(); + } else { + exportBlock_ = value; + } + + bitField0_ |= 0x00000008; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; + */ + public Builder clearExportBlock() { + exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000008); + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public boolean hasInitializerBlock() { + return ((bitField0_ & 0x00000010) == 0x00000010); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock() { + return initializerBlock_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public Builder setInitializerBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + initializerBlock_ = value; + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public Builder setInitializerBlock( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + initializerBlock_ = builderForValue.build(); + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public Builder mergeInitializerBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (((bitField0_ & 0x00000010) == 0x00000010) && + initializerBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + initializerBlock_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(initializerBlock_).mergeFrom(value).buildPartial(); + } else { + initializerBlock_ = value; + } + + bitField0_ |= 0x00000010; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; + */ + public Builder clearInitializerBlock() { + initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000010); + return this; + } + + private java.util.List nameBinding_ = + java.util.Collections.emptyList(); + private void ensureNameBindingIsMutable() { + if (!((bitField0_ & 0x00000020) == 0x00000020)) { + nameBinding_ = new java.util.ArrayList(nameBinding_); + bitField0_ |= 0x00000020; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public java.util.List getNameBindingList() { + return java.util.Collections.unmodifiableList(nameBinding_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public int getNameBindingCount() { + return nameBinding_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index) { + return nameBinding_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder setNameBinding( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNameBindingIsMutable(); + nameBinding_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder setNameBinding( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { + ensureNameBindingIsMutable(); + nameBinding_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addNameBinding(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNameBindingIsMutable(); + nameBinding_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addNameBinding( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { + if (value == null) { + throw new NullPointerException(); + } + ensureNameBindingIsMutable(); + nameBinding_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addNameBinding( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { + ensureNameBindingIsMutable(); + nameBinding_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addNameBinding( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { + ensureNameBindingIsMutable(); + nameBinding_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder addAllNameBinding( + java.lang.Iterable values) { + ensureNameBindingIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, nameBinding_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder clearNameBinding() { + nameBinding_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000020); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; + */ + public Builder removeNameBinding(int index) { + ensureNameBindingIsMutable(); + nameBinding_.remove(index); + + return this; + } + + private java.util.List classModel_ = + java.util.Collections.emptyList(); + private void ensureClassModelIsMutable() { + if (!((bitField0_ & 0x00000040) == 0x00000040)) { + classModel_ = new java.util.ArrayList(classModel_); + bitField0_ |= 0x00000040; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public java.util.List getClassModelList() { + return java.util.Collections.unmodifiableList(classModel_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public int getClassModelCount() { + return classModel_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index) { + return classModel_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder setClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClassModelIsMutable(); + classModel_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder setClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { + ensureClassModelIsMutable(); + classModel_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addClassModel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClassModelIsMutable(); + classModel_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureClassModelIsMutable(); + classModel_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addClassModel( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { + ensureClassModelIsMutable(); + classModel_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { + ensureClassModelIsMutable(); + classModel_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder addAllClassModel( + java.lang.Iterable values) { + ensureClassModelIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, classModel_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder clearClassModel() { + classModel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000040); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; + */ + public Builder removeClassModel(int index) { + ensureClassModelIsMutable(); + classModel_.remove(index); + + return this; + } + + private java.util.List moduleExpression_ = + java.util.Collections.emptyList(); + private void ensureModuleExpressionIsMutable() { + if (!((bitField0_ & 0x00000080) == 0x00000080)) { + moduleExpression_ = new java.util.ArrayList(moduleExpression_); + bitField0_ |= 0x00000080; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public java.util.List getModuleExpressionList() { + return java.util.Collections.unmodifiableList(moduleExpression_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public int getModuleExpressionCount() { + return moduleExpression_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index) { + return moduleExpression_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder setModuleExpression( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModuleExpressionIsMutable(); + moduleExpression_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder setModuleExpression( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { + ensureModuleExpressionIsMutable(); + moduleExpression_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addModuleExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModuleExpressionIsMutable(); + moduleExpression_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addModuleExpression( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { + if (value == null) { + throw new NullPointerException(); + } + ensureModuleExpressionIsMutable(); + moduleExpression_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addModuleExpression( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { + ensureModuleExpressionIsMutable(); + moduleExpression_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addModuleExpression( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { + ensureModuleExpressionIsMutable(); + moduleExpression_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder addAllModuleExpression( + java.lang.Iterable values) { + ensureModuleExpressionIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, moduleExpression_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder clearModuleExpression() { + moduleExpression_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000080); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; + */ + public Builder removeModuleExpression(int index) { + ensureModuleExpressionIsMutable(); + moduleExpression_.remove(index); + + return this; + } + + private java.util.List inlineModule_ = + java.util.Collections.emptyList(); + private void ensureInlineModuleIsMutable() { + if (!((bitField0_ & 0x00000100) == 0x00000100)) { + inlineModule_ = new java.util.ArrayList(inlineModule_); + bitField0_ |= 0x00000100; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public java.util.List getInlineModuleList() { + return java.util.Collections.unmodifiableList(inlineModule_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public int getInlineModuleCount() { + return inlineModule_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index) { + return inlineModule_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder setInlineModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlineModuleIsMutable(); + inlineModule_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder setInlineModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { + ensureInlineModuleIsMutable(); + inlineModule_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addInlineModule(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlineModuleIsMutable(); + inlineModule_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addInlineModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlineModuleIsMutable(); + inlineModule_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addInlineModule( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { + ensureInlineModuleIsMutable(); + inlineModule_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addInlineModule( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { + ensureInlineModuleIsMutable(); + inlineModule_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder addAllInlineModule( + java.lang.Iterable values) { + ensureInlineModuleIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, inlineModule_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder clearInlineModule() { + inlineModule_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000100); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; + */ + public Builder removeInlineModule(int index) { + ensureInlineModuleIsMutable(); + inlineModule_.remove(index); + + return this; + } + + private java.lang.Object packageFqn_ = ""; + /** + * optional string package_fqn = 10; + */ + public boolean hasPackageFqn() { + return ((bitField0_ & 0x00000200) == 0x00000200); + } + /** + * optional string package_fqn = 10; + */ + public java.lang.String getPackageFqn() { + java.lang.Object ref = packageFqn_; + if (!(ref instanceof java.lang.String)) { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + packageFqn_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string package_fqn = 10; + */ + public org.jetbrains.kotlin.protobuf.ByteString + getPackageFqnBytes() { + java.lang.Object ref = packageFqn_; + if (ref instanceof String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + packageFqn_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } + /** + * optional string package_fqn = 10; + */ + public Builder setPackageFqn( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + packageFqn_ = value; + + return this; + } + /** + * optional string package_fqn = 10; + */ + public Builder clearPackageFqn() { + bitField0_ = (bitField0_ & ~0x00000200); + packageFqn_ = getDefaultInstance().getPackageFqn(); + + return this; + } + /** + * optional string package_fqn = 10; + */ + public Builder setPackageFqnBytes( + org.jetbrains.kotlin.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000200; + packageFqn_ = value; + + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public boolean hasTestsInvocation() { + return ((bitField0_ & 0x00000400) == 0x00000400); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation() { + return testsInvocation_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public Builder setTestsInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { + if (value == null) { + throw new NullPointerException(); + } + testsInvocation_ = value; + + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public Builder setTestsInvocation( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder builderForValue) { + testsInvocation_ = builderForValue.build(); + + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public Builder mergeTestsInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { + if (((bitField0_ & 0x00000400) == 0x00000400) && + testsInvocation_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) { + testsInvocation_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder(testsInvocation_).mergeFrom(value).buildPartial(); + } else { + testsInvocation_ = value; + } + + bitField0_ |= 0x00000400; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; + */ + public Builder clearTestsInvocation() { + testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000400); + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public boolean hasMainInvocation() { + return ((bitField0_ & 0x00000800) == 0x00000800); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation() { + return mainInvocation_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public Builder setMainInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { + if (value == null) { + throw new NullPointerException(); + } + mainInvocation_ = value; + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public Builder setMainInvocation( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder builderForValue) { + mainInvocation_ = builderForValue.build(); + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public Builder mergeMainInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { + if (((bitField0_ & 0x00000800) == 0x00000800) && + mainInvocation_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) { + mainInvocation_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder(mainInvocation_).mergeFrom(value).buildPartial(); + } else { + mainInvocation_ = value; + } + + bitField0_ |= 0x00000800; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; + */ + public Builder clearMainInvocation() { + mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00000800); + return this; + } + + private java.util.List inlinedLocalDeclarations_ = + java.util.Collections.emptyList(); + private void ensureInlinedLocalDeclarationsIsMutable() { + if (!((bitField0_ & 0x00001000) == 0x00001000)) { + inlinedLocalDeclarations_ = new java.util.ArrayList(inlinedLocalDeclarations_); + bitField0_ |= 0x00001000; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public java.util.List getInlinedLocalDeclarationsList() { + return java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public int getInlinedLocalDeclarationsCount() { + return inlinedLocalDeclarations_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index) { + return inlinedLocalDeclarations_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder setInlinedLocalDeclarations( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder setInlinedLocalDeclarations( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addInlinedLocalDeclarations(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addInlinedLocalDeclarations( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { + if (value == null) { + throw new NullPointerException(); + } + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addInlinedLocalDeclarations( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addInlinedLocalDeclarations( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder addAllInlinedLocalDeclarations( + java.lang.Iterable values) { + ensureInlinedLocalDeclarationsIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, inlinedLocalDeclarations_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder clearInlinedLocalDeclarations() { + inlinedLocalDeclarations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00001000); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; + */ + public Builder removeInlinedLocalDeclarations(int index) { + ensureInlinedLocalDeclarationsIsMutable(); + inlinedLocalDeclarations_.remove(index); + + return this; + } + + private java.util.List irClassModel_ = + java.util.Collections.emptyList(); + private void ensureIrClassModelIsMutable() { + if (!((bitField0_ & 0x00002000) == 0x00002000)) { + irClassModel_ = new java.util.ArrayList(irClassModel_); + bitField0_ |= 0x00002000; + } + } + + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public java.util.List getIrClassModelList() { + return java.util.Collections.unmodifiableList(irClassModel_); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public int getIrClassModelCount() { + return irClassModel_.size(); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getIrClassModel(int index) { + return irClassModel_.get(index); + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder setIrClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIrClassModelIsMutable(); + irClassModel_.set(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder setIrClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.Builder builderForValue) { + ensureIrClassModelIsMutable(); + irClassModel_.set(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addIrClassModel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIrClassModelIsMutable(); + irClassModel_.add(value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addIrClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel value) { + if (value == null) { + throw new NullPointerException(); + } + ensureIrClassModelIsMutable(); + irClassModel_.add(index, value); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addIrClassModel( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.Builder builderForValue) { + ensureIrClassModelIsMutable(); + irClassModel_.add(builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addIrClassModel( + int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.Builder builderForValue) { + ensureIrClassModelIsMutable(); + irClassModel_.add(index, builderForValue.build()); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder addAllIrClassModel( + java.lang.Iterable values) { + ensureIrClassModelIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, irClassModel_); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder clearIrClassModel() { + irClassModel_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00002000); + + return this; + } + /** + * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; + */ + public Builder removeIrClassModel(int index) { + ensureIrClassModelIsMutable(); + irClassModel_.remove(index); + + return this; + } + + private java.lang.Object dts_ = ""; + /** + * optional string dts = 15; + */ + public boolean hasDts() { + return ((bitField0_ & 0x00004000) == 0x00004000); + } + /** + * optional string dts = 15; + */ + public java.lang.String getDts() { + java.lang.Object ref = dts_; + if (!(ref instanceof java.lang.String)) { + org.jetbrains.kotlin.protobuf.ByteString bs = + (org.jetbrains.kotlin.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + dts_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string dts = 15; + */ + public org.jetbrains.kotlin.protobuf.ByteString + getDtsBytes() { + java.lang.Object ref = dts_; + if (ref instanceof String) { + org.jetbrains.kotlin.protobuf.ByteString b = + org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dts_ = b; + return b; + } else { + return (org.jetbrains.kotlin.protobuf.ByteString) ref; + } + } + /** + * optional string dts = 15; + */ + public Builder setDts( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + dts_ = value; + + return this; + } + /** + * optional string dts = 15; + */ + public Builder clearDts() { + bitField0_ = (bitField0_ & ~0x00004000); + dts_ = getDefaultInstance().getDts(); + + return this; + } + /** + * optional string dts = 15; + */ + public Builder setDtsBytes( + org.jetbrains.kotlin.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + dts_ = value; + + return this; + } + + private int suiteFunction_ ; + /** + * optional int32 suite_function = 16; + */ + public boolean hasSuiteFunction() { + return ((bitField0_ & 0x00008000) == 0x00008000); + } + /** + * optional int32 suite_function = 16; + */ + public int getSuiteFunction() { + return suiteFunction_; + } + /** + * optional int32 suite_function = 16; + */ + public Builder setSuiteFunction(int value) { + bitField0_ |= 0x00008000; + suiteFunction_ = value; + + return this; + } + /** + * optional int32 suite_function = 16; + */ + public Builder clearSuiteFunction() { + bitField0_ = (bitField0_ & ~0x00008000); + suiteFunction_ = 0; + + return this; + } + + private java.util.List definitions_ = java.util.Collections.emptyList(); + private void ensureDefinitionsIsMutable() { + if (!((bitField0_ & 0x00010000) == 0x00010000)) { + definitions_ = new java.util.ArrayList(definitions_); + bitField0_ |= 0x00010000; + } + } + /** + * repeated int32 definitions = 17; + */ + public java.util.List + getDefinitionsList() { + return java.util.Collections.unmodifiableList(definitions_); + } + /** + * repeated int32 definitions = 17; + */ + public int getDefinitionsCount() { + return definitions_.size(); + } + /** + * repeated int32 definitions = 17; + */ + public int getDefinitions(int index) { + return definitions_.get(index); + } + /** + * repeated int32 definitions = 17; + */ + public Builder setDefinitions( + int index, int value) { + ensureDefinitionsIsMutable(); + definitions_.set(index, value); + + return this; + } + /** + * repeated int32 definitions = 17; + */ + public Builder addDefinitions(int value) { + ensureDefinitionsIsMutable(); + definitions_.add(value); + + return this; + } + /** + * repeated int32 definitions = 17; + */ + public Builder addAllDefinitions( + java.lang.Iterable values) { + ensureDefinitionsIsMutable(); + org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( + values, definitions_); + + return this; + } + /** + * repeated int32 definitions = 17; + */ + public Builder clearDefinitions() { + definitions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00010000); + + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock polyfills_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + public boolean hasPolyfills() { + return ((bitField0_ & 0x00020000) == 0x00020000); + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPolyfills() { + return polyfills_; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + public Builder setPolyfills(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (value == null) { + throw new NullPointerException(); + } + polyfills_ = value; + + bitField0_ |= 0x00020000; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + public Builder setPolyfills( + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { + polyfills_ = builderForValue.build(); + + bitField0_ |= 0x00020000; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + public Builder mergePolyfills(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { + if (((bitField0_ & 0x00020000) == 0x00020000) && + polyfills_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { + polyfills_ = + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(polyfills_).mergeFrom(value).buildPartial(); + } else { + polyfills_ = value; + } + + bitField0_ |= 0x00020000; + return this; + } + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock polyfills = 18; + */ + public Builder clearPolyfills() { + polyfills_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + bitField0_ = (bitField0_ & ~0x00020000); + return this; + } + + // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.Fragment) + } + + static { + defaultInstance = new Fragment(true); + defaultInstance.initFields(); + } + + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Fragment) + } + public interface InlinedLocalDeclarationsOrBuilder extends // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations) org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { @@ -33855,3208 +37324,50 @@ public enum StatementCase // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.ClassModel) } - /** - * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Fragment} - */ - public static final class Fragment extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite implements - // @@protoc_insertion_point(message_implements:org.jetbrains.kotlin.serialization.js.ast.Fragment) - FragmentOrBuilder { - public static final int IMPORTED_MODULE_FIELD_NUMBER = 1; - public static final int IMPORT_ENTRY_FIELD_NUMBER = 2; - public static final int DECLARATION_BLOCK_FIELD_NUMBER = 3; - public static final int EXPORT_BLOCK_FIELD_NUMBER = 4; - public static final int INITIALIZER_BLOCK_FIELD_NUMBER = 5; - - private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; - public static final int NAME_BINDING_FIELD_NUMBER = 6; - public static final int CLASS_MODEL_FIELD_NUMBER = 7; - public static final int MODULE_EXPRESSION_FIELD_NUMBER = 8; - public static final int INLINE_MODULE_FIELD_NUMBER = 9; - public static final int PACKAGE_FQN_FIELD_NUMBER = 10; - public static final int TESTS_INVOCATION_FIELD_NUMBER = 11; - public static final int MAIN_INVOCATION_FIELD_NUMBER = 12; - public static final int INLINED_LOCAL_DECLARATIONS_FIELD_NUMBER = 13; - public static final int IR_CLASS_MODEL_FIELD_NUMBER = 14; - public static final int DTS_FIELD_NUMBER = 15; - public static final int SUITE_FUNCTION_FIELD_NUMBER = 16; - public static final int DEFINITIONS_FIELD_NUMBER = 17; - private static final Fragment defaultInstance; - public static org.jetbrains.kotlin.protobuf.Parser PARSER = - new org.jetbrains.kotlin.protobuf.AbstractParser() { - public Fragment parsePartialFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return new Fragment(input, extensionRegistry); - } - }; - private static final long serialVersionUID = 0L; - - private int bitField0_; - private java.util.List importedModule_; - private java.util.List importEntry_; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock declarationBlock_; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock exportBlock_; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock initializerBlock_; - private java.util.List nameBinding_; - private java.util.List classModel_; - private java.util.List moduleExpression_; - private java.util.List inlineModule_; - private java.lang.Object packageFqn_; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement testsInvocation_; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement mainInvocation_; - private java.util.List inlinedLocalDeclarations_; - private java.util.List irClassModel_; - private java.lang.Object dts_; - private int suiteFunction_; - - static { - defaultInstance = new Fragment(true); - defaultInstance.initFields(); - } - - private java.util.List definitions_; - private byte memoizedIsInitialized = -1; - private int memoizedSerializedSize = -1; - // Use Fragment.newBuilder() to construct. - private Fragment(org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder builder) { - super(builder); - this.unknownFields = builder.getUnknownFields(); - } - - private Fragment(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} - - private Fragment( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - initFields(); - int mutable_bitField0_ = 0; - org.jetbrains.kotlin.protobuf.ByteString.Output unknownFieldsOutput = - org.jetbrains.kotlin.protobuf.ByteString.newOutput(); - org.jetbrains.kotlin.protobuf.CodedOutputStream unknownFieldsCodedOutput = - org.jetbrains.kotlin.protobuf.CodedOutputStream.newInstance( - unknownFieldsOutput, 1); - try { - boolean done = false; - while (!done) { - int tag = input.readTag(); - switch (tag) { - case 0: - done = true; - break; - default: { - if (!parseUnknownField(input, unknownFieldsCodedOutput, - extensionRegistry, tag)) { - done = true; - } - break; - } - case 10: { - if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - importedModule_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000001; - } - importedModule_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.PARSER, extensionRegistry)); - break; - } - case 18: { - if (!((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - importEntry_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000002; - } - importEntry_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.PARSER, extensionRegistry)); - break; - } - case 26: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - subBuilder = declarationBlock_.toBuilder(); - } - declarationBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(declarationBlock_); - declarationBlock_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000001; - break; - } - case 34: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - subBuilder = exportBlock_.toBuilder(); - } - exportBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(exportBlock_); - exportBlock_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000002; - break; - } - case 42: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder subBuilder = null; - if (((bitField0_ & 0x00000004) == 0x00000004)) { - subBuilder = initializerBlock_.toBuilder(); - } - initializerBlock_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(initializerBlock_); - initializerBlock_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000004; - break; - } - case 50: { - if (!((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - nameBinding_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000020; - } - nameBinding_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.PARSER, extensionRegistry)); - break; - } - case 58: { - if (!((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - classModel_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000040; - } - classModel_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.PARSER, extensionRegistry)); - break; - } - case 66: { - if (!((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - moduleExpression_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000080; - } - moduleExpression_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.PARSER, extensionRegistry)); - break; - } - case 74: { - if (!((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - inlineModule_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00000100; - } - inlineModule_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.PARSER, extensionRegistry)); - break; - } - case 82: { - org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000008; - packageFqn_ = bs; - break; - } - case 90: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder subBuilder = null; - if (((bitField0_ & 0x00000010) == 0x00000010)) { - subBuilder = testsInvocation_.toBuilder(); - } - testsInvocation_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(testsInvocation_); - testsInvocation_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000010; - break; - } - case 98: { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder subBuilder = null; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - subBuilder = mainInvocation_.toBuilder(); - } - mainInvocation_ = input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(mainInvocation_); - mainInvocation_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00000020; - break; - } - case 106: { - if (!((mutable_bitField0_ & 0x00001000) == 0x00001000)) { - inlinedLocalDeclarations_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00001000; - } - inlinedLocalDeclarations_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.PARSER, extensionRegistry)); - break; - } - case 114: { - if (!((mutable_bitField0_ & 0x00002000) == 0x00002000)) { - irClassModel_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00002000; - } - irClassModel_.add(input.readMessage(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.PARSER, extensionRegistry)); - break; - } - case 122: { - org.jetbrains.kotlin.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00000040; - dts_ = bs; - break; - } - case 128: { - bitField0_ |= 0x00000080; - suiteFunction_ = input.readInt32(); - break; - } - case 136: { - if (!((mutable_bitField0_ & 0x00010000) == 0x00010000)) { - definitions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00010000; - } - definitions_.add(input.readInt32()); - break; - } - case 138: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00010000) == 0x00010000) && input.getBytesUntilLimit() > 0) { - definitions_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00010000; - } - while (input.getBytesUntilLimit() > 0) { - definitions_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - } - } - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - throw e.setUnfinishedMessage(this); - } catch (java.io.IOException e) { - throw new org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException( - e.getMessage()).setUnfinishedMessage(this); - } finally { - if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) { - importedModule_ = java.util.Collections.unmodifiableList(importedModule_); - } - if (((mutable_bitField0_ & 0x00000002) == 0x00000002)) { - importEntry_ = java.util.Collections.unmodifiableList(importEntry_); - } - if (((mutable_bitField0_ & 0x00000020) == 0x00000020)) { - nameBinding_ = java.util.Collections.unmodifiableList(nameBinding_); - } - if (((mutable_bitField0_ & 0x00000040) == 0x00000040)) { - classModel_ = java.util.Collections.unmodifiableList(classModel_); - } - if (((mutable_bitField0_ & 0x00000080) == 0x00000080)) { - moduleExpression_ = java.util.Collections.unmodifiableList(moduleExpression_); - } - if (((mutable_bitField0_ & 0x00000100) == 0x00000100)) { - inlineModule_ = java.util.Collections.unmodifiableList(inlineModule_); - } - if (((mutable_bitField0_ & 0x00001000) == 0x00001000)) { - inlinedLocalDeclarations_ = java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); - } - if (((mutable_bitField0_ & 0x00002000) == 0x00002000)) { - irClassModel_ = java.util.Collections.unmodifiableList(irClassModel_); - } - if (((mutable_bitField0_ & 0x00010000) == 0x00010000)) { - definitions_ = java.util.Collections.unmodifiableList(definitions_); - } - try { - unknownFieldsCodedOutput.flush(); - } catch (java.io.IOException e) { - // Should not happen - } finally { - unknownFields = unknownFieldsOutput.toByteString(); - } - makeExtensionsImmutable(); - } - } - - public static Fragment getDefaultInstance() { - return defaultInstance; - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - org.jetbrains.kotlin.protobuf.ByteString data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom(byte[] data) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - byte[] data, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException { - return PARSER.parseFrom(data, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseDelimitedFrom(java.io.InputStream input) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseDelimitedFrom( - java.io.InputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseDelimitedFrom(input, extensionRegistry); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input) - throws java.io.IOException { - return PARSER.parseFrom(input); - } - - public static org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parseFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - return PARSER.parseFrom(input, extensionRegistry); - } - - public static Builder newBuilder(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment prototype) { - return newBuilder().mergeFrom(prototype); - } - - public static Builder newBuilder() { return Builder.create(); } - - public Fragment getDefaultInstanceForType() { - return defaultInstance; - } - - @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { - return PARSER; - } + public interface IrClassModelOrBuilder extends + // @@protoc_insertion_point(interface_extends:org.jetbrains.kotlin.serialization.js.ast.IrClassModel) + org.jetbrains.kotlin.protobuf.MessageLiteOrBuilder { /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + * required int32 name_id = 1; */ - public java.util.List getImportedModuleList() { - return importedModule_; - } + boolean hasNameId(); + /** + * required int32 name_id = 1; + */ + int getNameId(); /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + * repeated int32 super_classes = 2; */ - public java.util.List - getImportedModuleOrBuilderList() { - return importedModule_; - } + java.util.List getSuperClassesList(); + /** + * repeated int32 super_classes = 2; + */ + int getSuperClassesCount(); + /** + * repeated int32 super_classes = 2; + */ + int getSuperClasses(int index); /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; */ - public int getImportedModuleCount() { - return importedModule_.size(); - } + boolean hasPreDeclarationBlock(); + /** + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; + */ + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPreDeclarationBlock(); /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index) { - return importedModule_.get(index); - } - + boolean hasPostDeclarationBlock(); /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; + * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModuleOrBuilder getImportedModuleOrBuilder( - int index) { - return importedModule_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public java.util.List getImportEntryList() { - return importEntry_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public java.util.List - getImportEntryOrBuilderList() { - return importEntry_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public int getImportEntryCount() { - return importEntry_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index) { - return importEntry_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportOrBuilder getImportEntryOrBuilder( - int index) { - return importEntry_.get(index); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public boolean hasDeclarationBlock() { - return ((bitField0_ & 0x00000001) == 0x00000001); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock() { - return declarationBlock_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public boolean hasExportBlock() { - return ((bitField0_ & 0x00000002) == 0x00000002); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock() { - return exportBlock_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public boolean hasInitializerBlock() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock() { - return initializerBlock_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public java.util.List getNameBindingList() { - return nameBinding_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public java.util.List - getNameBindingOrBuilderList() { - return nameBinding_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public int getNameBindingCount() { - return nameBinding_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index) { - return nameBinding_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBindingOrBuilder getNameBindingOrBuilder( - int index) { - return nameBinding_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public java.util.List getClassModelList() { - return classModel_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public java.util.List - getClassModelOrBuilderList() { - return classModel_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public int getClassModelCount() { - return classModel_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index) { - return classModel_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModelOrBuilder getClassModelOrBuilder( - int index) { - return classModel_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public java.util.List getModuleExpressionList() { - return moduleExpression_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public java.util.List - getModuleExpressionOrBuilderList() { - return moduleExpression_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public int getModuleExpressionCount() { - return moduleExpression_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index) { - return moduleExpression_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ExpressionOrBuilder getModuleExpressionOrBuilder( - int index) { - return moduleExpression_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public java.util.List getInlineModuleList() { - return inlineModule_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public java.util.List - getInlineModuleOrBuilderList() { - return inlineModule_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public int getInlineModuleCount() { - return inlineModule_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index) { - return inlineModule_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModuleOrBuilder getInlineModuleOrBuilder( - int index) { - return inlineModule_.get(index); - } - - /** - * optional string package_fqn = 10; - */ - public boolean hasPackageFqn() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - - /** - * optional string package_fqn = 10; - */ - public java.lang.String getPackageFqn() { - java.lang.Object ref = packageFqn_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - org.jetbrains.kotlin.protobuf.ByteString bs = - (org.jetbrains.kotlin.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - packageFqn_ = s; - } - return s; - } - } - - /** - * optional string package_fqn = 10; - */ - public org.jetbrains.kotlin.protobuf.ByteString - getPackageFqnBytes() { - java.lang.Object ref = packageFqn_; - if (ref instanceof java.lang.String) { - org.jetbrains.kotlin.protobuf.ByteString b = - org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - packageFqn_ = b; - return b; - } else { - return (org.jetbrains.kotlin.protobuf.ByteString) ref; - } - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public boolean hasTestsInvocation() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation() { - return testsInvocation_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public boolean hasMainInvocation() { - return ((bitField0_ & 0x00000020) == 0x00000020); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation() { - return mainInvocation_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public java.util.List getInlinedLocalDeclarationsList() { - return inlinedLocalDeclarations_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public java.util.List - getInlinedLocalDeclarationsOrBuilderList() { - return inlinedLocalDeclarations_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public int getInlinedLocalDeclarationsCount() { - return inlinedLocalDeclarations_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public java.util.List getIrClassModelList() { - return irClassModel_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public java.util.List - getIrClassModelOrBuilderList() { - return irClassModel_; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public int getIrClassModelCount() { - return irClassModel_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getIrClassModel(int index) { - return irClassModel_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModelOrBuilder getIrClassModelOrBuilder( - int index) { - return irClassModel_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index) { - return inlinedLocalDeclarations_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarationsOrBuilder getInlinedLocalDeclarationsOrBuilder( - int index) { - return inlinedLocalDeclarations_.get(index); - } - - /** - * optional string dts = 15; - */ - public boolean hasDts() { - return ((bitField0_ & 0x00000040) == 0x00000040); - } - - /** - * optional string dts = 15; - */ - public java.lang.String getDts() { - java.lang.Object ref = dts_; - if (ref instanceof java.lang.String) { - return (java.lang.String) ref; - } else { - org.jetbrains.kotlin.protobuf.ByteString bs = - (org.jetbrains.kotlin.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - dts_ = s; - } - return s; - } - } - - /** - * optional string dts = 15; - */ - public org.jetbrains.kotlin.protobuf.ByteString - getDtsBytes() { - java.lang.Object ref = dts_; - if (ref instanceof java.lang.String) { - org.jetbrains.kotlin.protobuf.ByteString b = - org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dts_ = b; - return b; - } else { - return (org.jetbrains.kotlin.protobuf.ByteString) ref; - } - } - - /** - * optional int32 suite_function = 16; - */ - public boolean hasSuiteFunction() { - return ((bitField0_ & 0x00000080) == 0x00000080); - } - - /** - * optional int32 suite_function = 16; - */ - public int getSuiteFunction() { - return suiteFunction_; - } - - @java.lang.Override - protected java.lang.Object writeReplace() - throws java.io.ObjectStreamException { - return super.writeReplace(); - } - - /** - * repeated int32 definitions = 17; - */ - public java.util.List - getDefinitionsList() { - return definitions_; - } - - /** - * repeated int32 definitions = 17; - */ - public int getDefinitionsCount() { - return definitions_.size(); - } - - /** - * repeated int32 definitions = 17; - */ - public int getDefinitions(int index) { - return definitions_.get(index); - } - - public final boolean isInitialized() { - byte isInitialized = memoizedIsInitialized; - if (isInitialized == 1) return true; - if (isInitialized == 0) return false; - - for (int i = 0; i < getImportedModuleCount(); i++) { - if (!getImportedModule(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getImportEntryCount(); i++) { - if (!getImportEntry(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasDeclarationBlock()) { - if (!getDeclarationBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasExportBlock()) { - if (!getExportBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasInitializerBlock()) { - if (!getInitializerBlock().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getNameBindingCount(); i++) { - if (!getNameBinding(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getClassModelCount(); i++) { - if (!getClassModel(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getModuleExpressionCount(); i++) { - if (!getModuleExpression(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getInlineModuleCount(); i++) { - if (!getInlineModule(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasTestsInvocation()) { - if (!getTestsInvocation().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - if (hasMainInvocation()) { - if (!getMainInvocation().isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getInlinedLocalDeclarationsCount(); i++) { - if (!getInlinedLocalDeclarations(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - for (int i = 0; i < getIrClassModelCount(); i++) { - if (!getIrClassModel(i).isInitialized()) { - memoizedIsInitialized = 0; - return false; - } - } - memoizedIsInitialized = 1; - return true; - } - - private void initFields() { - importedModule_ = java.util.Collections.emptyList(); - importEntry_ = java.util.Collections.emptyList(); - declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - nameBinding_ = java.util.Collections.emptyList(); - classModel_ = java.util.Collections.emptyList(); - moduleExpression_ = java.util.Collections.emptyList(); - inlineModule_ = java.util.Collections.emptyList(); - packageFqn_ = ""; - testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - inlinedLocalDeclarations_ = java.util.Collections.emptyList(); - irClassModel_ = java.util.Collections.emptyList(); - dts_ = ""; - suiteFunction_ = 0; - definitions_ = java.util.Collections.emptyList(); - } - - public Builder newBuilderForType() { return newBuilder(); } - - public void writeTo(org.jetbrains.kotlin.protobuf.CodedOutputStream output) - throws java.io.IOException { - getSerializedSize(); - for (int i = 0; i < importedModule_.size(); i++) { - output.writeMessage(1, importedModule_.get(i)); - } - for (int i = 0; i < importEntry_.size(); i++) { - output.writeMessage(2, importEntry_.get(i)); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - output.writeMessage(3, declarationBlock_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - output.writeMessage(4, exportBlock_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - output.writeMessage(5, initializerBlock_); - } - for (int i = 0; i < nameBinding_.size(); i++) { - output.writeMessage(6, nameBinding_.get(i)); - } - for (int i = 0; i < classModel_.size(); i++) { - output.writeMessage(7, classModel_.get(i)); - } - for (int i = 0; i < moduleExpression_.size(); i++) { - output.writeMessage(8, moduleExpression_.get(i)); - } - for (int i = 0; i < inlineModule_.size(); i++) { - output.writeMessage(9, inlineModule_.get(i)); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - output.writeBytes(10, getPackageFqnBytes()); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - output.writeMessage(11, testsInvocation_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - output.writeMessage(12, mainInvocation_); - } - for (int i = 0; i < inlinedLocalDeclarations_.size(); i++) { - output.writeMessage(13, inlinedLocalDeclarations_.get(i)); - } - for (int i = 0; i < irClassModel_.size(); i++) { - output.writeMessage(14, irClassModel_.get(i)); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - output.writeBytes(15, getDtsBytes()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - output.writeInt32(16, suiteFunction_); - } - for (int i = 0; i < definitions_.size(); i++) { - output.writeInt32(17, definitions_.get(i)); - } - output.writeRawBytes(unknownFields); - } - public Builder toBuilder() { return newBuilder(this); } - - public int getSerializedSize() { - int size = memoizedSerializedSize; - if (size != -1) return size; - - size = 0; - for (int i = 0; i < importedModule_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(1, importedModule_.get(i)); - } - for (int i = 0; i < importEntry_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(2, importEntry_.get(i)); - } - if (((bitField0_ & 0x00000001) == 0x00000001)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(3, declarationBlock_); - } - if (((bitField0_ & 0x00000002) == 0x00000002)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(4, exportBlock_); - } - if (((bitField0_ & 0x00000004) == 0x00000004)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(5, initializerBlock_); - } - for (int i = 0; i < nameBinding_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(6, nameBinding_.get(i)); - } - for (int i = 0; i < classModel_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(7, classModel_.get(i)); - } - for (int i = 0; i < moduleExpression_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(8, moduleExpression_.get(i)); - } - for (int i = 0; i < inlineModule_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(9, inlineModule_.get(i)); - } - if (((bitField0_ & 0x00000008) == 0x00000008)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeBytesSize(10, getPackageFqnBytes()); - } - if (((bitField0_ & 0x00000010) == 0x00000010)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(11, testsInvocation_); - } - if (((bitField0_ & 0x00000020) == 0x00000020)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(12, mainInvocation_); - } - for (int i = 0; i < inlinedLocalDeclarations_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(13, inlinedLocalDeclarations_.get(i)); - } - for (int i = 0; i < irClassModel_.size(); i++) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeMessageSize(14, irClassModel_.get(i)); - } - if (((bitField0_ & 0x00000040) == 0x00000040)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeBytesSize(15, getDtsBytes()); - } - if (((bitField0_ & 0x00000080) == 0x00000080)) { - size += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeInt32Size(16, suiteFunction_); - } - { - int dataSize = 0; - for (int i = 0; i < definitions_.size(); i++) { - dataSize += org.jetbrains.kotlin.protobuf.CodedOutputStream - .computeInt32SizeNoTag(definitions_.get(i)); - } - size += dataSize; - size += 2 * getDefinitionsList().size(); - } - size += unknownFields.size(); - memoizedSerializedSize = size; - return size; - } - - /** - * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.Fragment} - */ - public static final class Builder extends - org.jetbrains.kotlin.protobuf.GeneratedMessageLite.Builder< - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment, Builder> - implements - // @@protoc_insertion_point(builder_implements:org.jetbrains.kotlin.serialization.js.ast.Fragment) - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.FragmentOrBuilder { - private java.util.List importedModule_ = - java.util.Collections.emptyList(); - - private void maybeForceBuilderInitialization() { - } - private static Builder create() { - return new Builder(); - } - private java.util.List importEntry_ = - java.util.Collections.emptyList(); - - public Builder clone() { - return create().mergeFrom(buildPartial()); - } - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - private java.util.List nameBinding_ = - java.util.Collections.emptyList(); - private java.util.List classModel_ = - java.util.Collections.emptyList(); - private java.util.List moduleExpression_ = - java.util.Collections.emptyList(); - private int bitField0_; - private java.util.List inlineModule_ = - java.util.Collections.emptyList(); - private java.lang.Object packageFqn_ = ""; - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - private java.util.List inlinedLocalDeclarations_ = - java.util.Collections.emptyList(); - private java.util.List irClassModel_ = - java.util.Collections.emptyList(); - private java.lang.Object dts_ = ""; - private int suiteFunction_ ; - private java.util.List definitions_ = java.util.Collections.emptyList(); - // Construct using org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.newBuilder() - private Builder() { - maybeForceBuilderInitialization(); - } - - public Builder clear() { - super.clear(); - importedModule_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - importEntry_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000004); - exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000008); - initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000010); - nameBinding_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - classModel_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - moduleExpression_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - inlineModule_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - packageFqn_ = ""; - bitField0_ = (bitField0_ & ~0x00000200); - testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000400); - mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - bitField0_ = (bitField0_ & ~0x00000800); - inlinedLocalDeclarations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); - irClassModel_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00002000); - dts_ = ""; - bitField0_ = (bitField0_ & ~0x00004000); - suiteFunction_ = 0; - bitField0_ = (bitField0_ & ~0x00008000); - definitions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00010000); - return this; - } - - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment getDefaultInstanceForType() { - return org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.getDefaultInstance(); - } - - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment build() { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment result = buildPartial(); - if (!result.isInitialized()) { - throw newUninitializedMessageException(result); - } - return result; - } - - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment buildPartial() { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment result = new org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment(this); - int from_bitField0_ = bitField0_; - int to_bitField0_ = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { - importedModule_ = java.util.Collections.unmodifiableList(importedModule_); - bitField0_ = (bitField0_ & ~0x00000001); - } - result.importedModule_ = importedModule_; - if (((bitField0_ & 0x00000002) == 0x00000002)) { - importEntry_ = java.util.Collections.unmodifiableList(importEntry_); - bitField0_ = (bitField0_ & ~0x00000002); - } - result.importEntry_ = importEntry_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { - to_bitField0_ |= 0x00000001; - } - result.declarationBlock_ = declarationBlock_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { - to_bitField0_ |= 0x00000002; - } - result.exportBlock_ = exportBlock_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { - to_bitField0_ |= 0x00000004; - } - result.initializerBlock_ = initializerBlock_; - if (((bitField0_ & 0x00000020) == 0x00000020)) { - nameBinding_ = java.util.Collections.unmodifiableList(nameBinding_); - bitField0_ = (bitField0_ & ~0x00000020); - } - result.nameBinding_ = nameBinding_; - if (((bitField0_ & 0x00000040) == 0x00000040)) { - classModel_ = java.util.Collections.unmodifiableList(classModel_); - bitField0_ = (bitField0_ & ~0x00000040); - } - result.classModel_ = classModel_; - if (((bitField0_ & 0x00000080) == 0x00000080)) { - moduleExpression_ = java.util.Collections.unmodifiableList(moduleExpression_); - bitField0_ = (bitField0_ & ~0x00000080); - } - result.moduleExpression_ = moduleExpression_; - if (((bitField0_ & 0x00000100) == 0x00000100)) { - inlineModule_ = java.util.Collections.unmodifiableList(inlineModule_); - bitField0_ = (bitField0_ & ~0x00000100); - } - result.inlineModule_ = inlineModule_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { - to_bitField0_ |= 0x00000008; - } - result.packageFqn_ = packageFqn_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { - to_bitField0_ |= 0x00000010; - } - result.testsInvocation_ = testsInvocation_; - if (((from_bitField0_ & 0x00000800) == 0x00000800)) { - to_bitField0_ |= 0x00000020; - } - result.mainInvocation_ = mainInvocation_; - if (((bitField0_ & 0x00001000) == 0x00001000)) { - inlinedLocalDeclarations_ = java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); - bitField0_ = (bitField0_ & ~0x00001000); - } - result.inlinedLocalDeclarations_ = inlinedLocalDeclarations_; - if (((bitField0_ & 0x00002000) == 0x00002000)) { - irClassModel_ = java.util.Collections.unmodifiableList(irClassModel_); - bitField0_ = (bitField0_ & ~0x00002000); - } - result.irClassModel_ = irClassModel_; - if (((from_bitField0_ & 0x00004000) == 0x00004000)) { - to_bitField0_ |= 0x00000040; - } - result.dts_ = dts_; - if (((from_bitField0_ & 0x00008000) == 0x00008000)) { - to_bitField0_ |= 0x00000080; - } - result.suiteFunction_ = suiteFunction_; - if (((bitField0_ & 0x00010000) == 0x00010000)) { - definitions_ = java.util.Collections.unmodifiableList(definitions_); - bitField0_ = (bitField0_ & ~0x00010000); - } - result.definitions_ = definitions_; - result.bitField0_ = to_bitField0_; - return result; - } - - public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment other) { - if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment.getDefaultInstance()) return this; - if (!other.importedModule_.isEmpty()) { - if (importedModule_.isEmpty()) { - importedModule_ = other.importedModule_; - bitField0_ = (bitField0_ & ~0x00000001); - } else { - ensureImportedModuleIsMutable(); - importedModule_.addAll(other.importedModule_); - } - - } - if (!other.importEntry_.isEmpty()) { - if (importEntry_.isEmpty()) { - importEntry_ = other.importEntry_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureImportEntryIsMutable(); - importEntry_.addAll(other.importEntry_); - } - - } - if (other.hasDeclarationBlock()) { - mergeDeclarationBlock(other.getDeclarationBlock()); - } - if (other.hasExportBlock()) { - mergeExportBlock(other.getExportBlock()); - } - if (other.hasInitializerBlock()) { - mergeInitializerBlock(other.getInitializerBlock()); - } - if (!other.nameBinding_.isEmpty()) { - if (nameBinding_.isEmpty()) { - nameBinding_ = other.nameBinding_; - bitField0_ = (bitField0_ & ~0x00000020); - } else { - ensureNameBindingIsMutable(); - nameBinding_.addAll(other.nameBinding_); - } - - } - if (!other.classModel_.isEmpty()) { - if (classModel_.isEmpty()) { - classModel_ = other.classModel_; - bitField0_ = (bitField0_ & ~0x00000040); - } else { - ensureClassModelIsMutable(); - classModel_.addAll(other.classModel_); - } - - } - if (!other.moduleExpression_.isEmpty()) { - if (moduleExpression_.isEmpty()) { - moduleExpression_ = other.moduleExpression_; - bitField0_ = (bitField0_ & ~0x00000080); - } else { - ensureModuleExpressionIsMutable(); - moduleExpression_.addAll(other.moduleExpression_); - } - - } - if (!other.inlineModule_.isEmpty()) { - if (inlineModule_.isEmpty()) { - inlineModule_ = other.inlineModule_; - bitField0_ = (bitField0_ & ~0x00000100); - } else { - ensureInlineModuleIsMutable(); - inlineModule_.addAll(other.inlineModule_); - } - - } - if (other.hasPackageFqn()) { - bitField0_ |= 0x00000200; - packageFqn_ = other.packageFqn_; - - } - if (other.hasTestsInvocation()) { - mergeTestsInvocation(other.getTestsInvocation()); - } - if (other.hasMainInvocation()) { - mergeMainInvocation(other.getMainInvocation()); - } - if (!other.inlinedLocalDeclarations_.isEmpty()) { - if (inlinedLocalDeclarations_.isEmpty()) { - inlinedLocalDeclarations_ = other.inlinedLocalDeclarations_; - bitField0_ = (bitField0_ & ~0x00001000); - } else { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.addAll(other.inlinedLocalDeclarations_); - } - - } - if (!other.irClassModel_.isEmpty()) { - if (irClassModel_.isEmpty()) { - irClassModel_ = other.irClassModel_; - bitField0_ = (bitField0_ & ~0x00002000); - } else { - ensureIrClassModelIsMutable(); - irClassModel_.addAll(other.irClassModel_); - } - - } - if (other.hasDts()) { - bitField0_ |= 0x00004000; - dts_ = other.dts_; - - } - if (other.hasSuiteFunction()) { - setSuiteFunction(other.getSuiteFunction()); - } - if (!other.definitions_.isEmpty()) { - if (definitions_.isEmpty()) { - definitions_ = other.definitions_; - bitField0_ = (bitField0_ & ~0x00010000); - } else { - ensureDefinitionsIsMutable(); - definitions_.addAll(other.definitions_); - } - - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - for (int i = 0; i < getImportedModuleCount(); i++) { - if (!getImportedModule(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getImportEntryCount(); i++) { - if (!getImportEntry(i).isInitialized()) { - - return false; - } - } - if (hasDeclarationBlock()) { - if (!getDeclarationBlock().isInitialized()) { - - return false; - } - } - if (hasExportBlock()) { - if (!getExportBlock().isInitialized()) { - - return false; - } - } - if (hasInitializerBlock()) { - if (!getInitializerBlock().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getNameBindingCount(); i++) { - if (!getNameBinding(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getClassModelCount(); i++) { - if (!getClassModel(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getModuleExpressionCount(); i++) { - if (!getModuleExpression(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getInlineModuleCount(); i++) { - if (!getInlineModule(i).isInitialized()) { - - return false; - } - } - if (hasTestsInvocation()) { - if (!getTestsInvocation().isInitialized()) { - - return false; - } - } - if (hasMainInvocation()) { - if (!getMainInvocation().isInitialized()) { - - return false; - } - } - for (int i = 0; i < getInlinedLocalDeclarationsCount(); i++) { - if (!getInlinedLocalDeclarations(i).isInitialized()) { - - return false; - } - } - for (int i = 0; i < getIrClassModelCount(); i++) { - if (!getIrClassModel(i).isInitialized()) { - - return false; - } - } - return true; - } - - public Builder mergeFrom( - org.jetbrains.kotlin.protobuf.CodedInputStream input, - org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) - throws java.io.IOException { - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment parsedMessage = null; - try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); - } catch (org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException e) { - parsedMessage = (org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Fragment) e.getUnfinishedMessage(); - throw e; - } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } - return this; - } - - private void ensureImportedModuleIsMutable() { - if (!((bitField0_ & 0x00000001) == 0x00000001)) { - importedModule_ = new java.util.ArrayList(importedModule_); - bitField0_ |= 0x00000001; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public java.util.List getImportedModuleList() { - return java.util.Collections.unmodifiableList(importedModule_); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public int getImportedModuleCount() { - return importedModule_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule getImportedModule(int index) { - return importedModule_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder setImportedModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportedModuleIsMutable(); - importedModule_.set(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder setImportedModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { - ensureImportedModuleIsMutable(); - importedModule_.set(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addImportedModule(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportedModuleIsMutable(); - importedModule_.add(value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addImportedModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportedModuleIsMutable(); - importedModule_.add(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addImportedModule( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { - ensureImportedModuleIsMutable(); - importedModule_.add(builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addImportedModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ImportedModule.Builder builderForValue) { - ensureImportedModuleIsMutable(); - importedModule_.add(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder addAllImportedModule( - java.lang.Iterable values) { - ensureImportedModuleIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, importedModule_); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder clearImportedModule() { - importedModule_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000001); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ImportedModule imported_module = 1; - */ - public Builder removeImportedModule(int index) { - ensureImportedModuleIsMutable(); - importedModule_.remove(index); - - return this; - } - - private void ensureImportEntryIsMutable() { - if (!((bitField0_ & 0x00000002) == 0x00000002)) { - importEntry_ = new java.util.ArrayList(importEntry_); - bitField0_ |= 0x00000002; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public java.util.List getImportEntryList() { - return java.util.Collections.unmodifiableList(importEntry_); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public int getImportEntryCount() { - return importEntry_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import getImportEntry(int index) { - return importEntry_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder setImportEntry( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportEntryIsMutable(); - importEntry_.set(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder setImportEntry( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { - ensureImportEntryIsMutable(); - importEntry_.set(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addImportEntry(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportEntryIsMutable(); - importEntry_.add(value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addImportEntry( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import value) { - if (value == null) { - throw new NullPointerException(); - } - ensureImportEntryIsMutable(); - importEntry_.add(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addImportEntry( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { - ensureImportEntryIsMutable(); - importEntry_.add(builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addImportEntry( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Import.Builder builderForValue) { - ensureImportEntryIsMutable(); - importEntry_.add(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder addAllImportEntry( - java.lang.Iterable values) { - ensureImportEntryIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, importEntry_); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder clearImportEntry() { - importEntry_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Import import_entry = 2; - */ - public Builder removeImportEntry(int index) { - ensureImportEntryIsMutable(); - importEntry_.remove(index); - - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public boolean hasDeclarationBlock() { - return ((bitField0_ & 0x00000004) == 0x00000004); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getDeclarationBlock() { - return declarationBlock_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public Builder setDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (value == null) { - throw new NullPointerException(); - } - declarationBlock_ = value; - - bitField0_ |= 0x00000004; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public Builder setDeclarationBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { - declarationBlock_ = builderForValue.build(); - - bitField0_ |= 0x00000004; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public Builder mergeDeclarationBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (((bitField0_ & 0x00000004) == 0x00000004) && - declarationBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { - declarationBlock_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(declarationBlock_).mergeFrom(value).buildPartial(); - } else { - declarationBlock_ = value; - } - - bitField0_ |= 0x00000004; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock declaration_block = 3; - */ - public Builder clearDeclarationBlock() { - declarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000004); - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public boolean hasExportBlock() { - return ((bitField0_ & 0x00000008) == 0x00000008); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getExportBlock() { - return exportBlock_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public Builder setExportBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (value == null) { - throw new NullPointerException(); - } - exportBlock_ = value; - - bitField0_ |= 0x00000008; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public Builder setExportBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { - exportBlock_ = builderForValue.build(); - - bitField0_ |= 0x00000008; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public Builder mergeExportBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (((bitField0_ & 0x00000008) == 0x00000008) && - exportBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { - exportBlock_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(exportBlock_).mergeFrom(value).buildPartial(); - } else { - exportBlock_ = value; - } - - bitField0_ |= 0x00000008; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock export_block = 4; - */ - public Builder clearExportBlock() { - exportBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000008); - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public boolean hasInitializerBlock() { - return ((bitField0_ & 0x00000010) == 0x00000010); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getInitializerBlock() { - return initializerBlock_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public Builder setInitializerBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (value == null) { - throw new NullPointerException(); - } - initializerBlock_ = value; - - bitField0_ |= 0x00000010; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public Builder setInitializerBlock( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.Builder builderForValue) { - initializerBlock_ = builderForValue.build(); - - bitField0_ |= 0x00000010; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public Builder mergeInitializerBlock(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock value) { - if (((bitField0_ & 0x00000010) == 0x00000010) && - initializerBlock_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance()) { - initializerBlock_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.newBuilder(initializerBlock_).mergeFrom(value).buildPartial(); - } else { - initializerBlock_ = value; - } - - bitField0_ |= 0x00000010; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock initializer_block = 5; - */ - public Builder clearInitializerBlock() { - initializerBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000010); - return this; - } - - private void ensureNameBindingIsMutable() { - if (!((bitField0_ & 0x00000020) == 0x00000020)) { - nameBinding_ = new java.util.ArrayList(nameBinding_); - bitField0_ |= 0x00000020; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public java.util.List getNameBindingList() { - return java.util.Collections.unmodifiableList(nameBinding_); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public int getNameBindingCount() { - return nameBinding_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding getNameBinding(int index) { - return nameBinding_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder setNameBinding( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNameBindingIsMutable(); - nameBinding_.set(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder setNameBinding( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { - ensureNameBindingIsMutable(); - nameBinding_.set(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addNameBinding(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNameBindingIsMutable(); - nameBinding_.add(value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addNameBinding( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding value) { - if (value == null) { - throw new NullPointerException(); - } - ensureNameBindingIsMutable(); - nameBinding_.add(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addNameBinding( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { - ensureNameBindingIsMutable(); - nameBinding_.add(builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addNameBinding( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.NameBinding.Builder builderForValue) { - ensureNameBindingIsMutable(); - nameBinding_.add(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder addAllNameBinding( - java.lang.Iterable values) { - ensureNameBindingIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, nameBinding_); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder clearNameBinding() { - nameBinding_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000020); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.NameBinding name_binding = 6; - */ - public Builder removeNameBinding(int index) { - ensureNameBindingIsMutable(); - nameBinding_.remove(index); - - return this; - } - - private void ensureClassModelIsMutable() { - if (!((bitField0_ & 0x00000040) == 0x00000040)) { - classModel_ = new java.util.ArrayList(classModel_); - bitField0_ |= 0x00000040; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public java.util.List getClassModelList() { - return java.util.Collections.unmodifiableList(classModel_); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public int getClassModelCount() { - return classModel_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel getClassModel(int index) { - return classModel_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder setClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { - if (value == null) { - throw new NullPointerException(); - } - ensureClassModelIsMutable(); - classModel_.set(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder setClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { - ensureClassModelIsMutable(); - classModel_.set(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addClassModel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { - if (value == null) { - throw new NullPointerException(); - } - ensureClassModelIsMutable(); - classModel_.add(value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel value) { - if (value == null) { - throw new NullPointerException(); - } - ensureClassModelIsMutable(); - classModel_.add(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addClassModel( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { - ensureClassModelIsMutable(); - classModel_.add(builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.ClassModel.Builder builderForValue) { - ensureClassModelIsMutable(); - classModel_.add(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder addAllClassModel( - java.lang.Iterable values) { - ensureClassModelIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, classModel_); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder clearClassModel() { - classModel_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000040); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.ClassModel class_model = 7; - */ - public Builder removeClassModel(int index) { - ensureClassModelIsMutable(); - classModel_.remove(index); - - return this; - } - - private void ensureModuleExpressionIsMutable() { - if (!((bitField0_ & 0x00000080) == 0x00000080)) { - moduleExpression_ = new java.util.ArrayList(moduleExpression_); - bitField0_ |= 0x00000080; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public java.util.List getModuleExpressionList() { - return java.util.Collections.unmodifiableList(moduleExpression_); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public int getModuleExpressionCount() { - return moduleExpression_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression getModuleExpression(int index) { - return moduleExpression_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder setModuleExpression( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureModuleExpressionIsMutable(); - moduleExpression_.set(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder setModuleExpression( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { - ensureModuleExpressionIsMutable(); - moduleExpression_.set(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addModuleExpression(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureModuleExpressionIsMutable(); - moduleExpression_.add(value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addModuleExpression( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression value) { - if (value == null) { - throw new NullPointerException(); - } - ensureModuleExpressionIsMutable(); - moduleExpression_.add(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addModuleExpression( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { - ensureModuleExpressionIsMutable(); - moduleExpression_.add(builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addModuleExpression( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Expression.Builder builderForValue) { - ensureModuleExpressionIsMutable(); - moduleExpression_.add(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder addAllModuleExpression( - java.lang.Iterable values) { - ensureModuleExpressionIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, moduleExpression_); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder clearModuleExpression() { - moduleExpression_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000080); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.Expression module_expression = 8; - */ - public Builder removeModuleExpression(int index) { - ensureModuleExpressionIsMutable(); - moduleExpression_.remove(index); - - return this; - } - - private void ensureInlineModuleIsMutable() { - if (!((bitField0_ & 0x00000100) == 0x00000100)) { - inlineModule_ = new java.util.ArrayList(inlineModule_); - bitField0_ |= 0x00000100; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public java.util.List getInlineModuleList() { - return java.util.Collections.unmodifiableList(inlineModule_); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public int getInlineModuleCount() { - return inlineModule_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule getInlineModule(int index) { - return inlineModule_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder setInlineModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlineModuleIsMutable(); - inlineModule_.set(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder setInlineModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { - ensureInlineModuleIsMutable(); - inlineModule_.set(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addInlineModule(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlineModuleIsMutable(); - inlineModule_.add(value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addInlineModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlineModuleIsMutable(); - inlineModule_.add(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addInlineModule( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { - ensureInlineModuleIsMutable(); - inlineModule_.add(builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addInlineModule( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlineModule.Builder builderForValue) { - ensureInlineModuleIsMutable(); - inlineModule_.add(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder addAllInlineModule( - java.lang.Iterable values) { - ensureInlineModuleIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, inlineModule_); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder clearInlineModule() { - inlineModule_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000100); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlineModule inline_module = 9; - */ - public Builder removeInlineModule(int index) { - ensureInlineModuleIsMutable(); - inlineModule_.remove(index); - - return this; - } - - /** - * optional string package_fqn = 10; - */ - public boolean hasPackageFqn() { - return ((bitField0_ & 0x00000200) == 0x00000200); - } - - /** - * optional string package_fqn = 10; - */ - public java.lang.String getPackageFqn() { - java.lang.Object ref = packageFqn_; - if (!(ref instanceof java.lang.String)) { - org.jetbrains.kotlin.protobuf.ByteString bs = - (org.jetbrains.kotlin.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - packageFqn_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string package_fqn = 10; - */ - public Builder setPackageFqn( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); + org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPostDeclarationBlock(); } - bitField0_ |= 0x00000200; - packageFqn_ = value; - - return this; - } - - /** - * optional string package_fqn = 10; - */ - public org.jetbrains.kotlin.protobuf.ByteString - getPackageFqnBytes() { - java.lang.Object ref = packageFqn_; - if (ref instanceof String) { - org.jetbrains.kotlin.protobuf.ByteString b = - org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - packageFqn_ = b; - return b; - } else { - return (org.jetbrains.kotlin.protobuf.ByteString) ref; - } - } - - /** - * optional string package_fqn = 10; - */ - public Builder setPackageFqnBytes( - org.jetbrains.kotlin.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00000200; - packageFqn_ = value; - - return this; - } - - /** - * optional string package_fqn = 10; - */ - public Builder clearPackageFqn() { - bitField0_ = (bitField0_ & ~0x00000200); - packageFqn_ = getDefaultInstance().getPackageFqn(); - - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public boolean hasTestsInvocation() { - return ((bitField0_ & 0x00000400) == 0x00000400); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getTestsInvocation() { - return testsInvocation_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public Builder setTestsInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { - if (value == null) { - throw new NullPointerException(); - } - testsInvocation_ = value; - - bitField0_ |= 0x00000400; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public Builder setTestsInvocation( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder builderForValue) { - testsInvocation_ = builderForValue.build(); - - bitField0_ |= 0x00000400; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public Builder mergeTestsInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { - if (((bitField0_ & 0x00000400) == 0x00000400) && - testsInvocation_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) { - testsInvocation_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder(testsInvocation_).mergeFrom(value).buildPartial(); - } else { - testsInvocation_ = value; - } - - bitField0_ |= 0x00000400; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement tests_invocation = 11; - */ - public Builder clearTestsInvocation() { - testsInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000400); - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public boolean hasMainInvocation() { - return ((bitField0_ & 0x00000800) == 0x00000800); - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement getMainInvocation() { - return mainInvocation_; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public Builder setMainInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { - if (value == null) { - throw new NullPointerException(); - } - mainInvocation_ = value; - - bitField0_ |= 0x00000800; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public Builder setMainInvocation( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.Builder builderForValue) { - mainInvocation_ = builderForValue.build(); - - bitField0_ |= 0x00000800; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public Builder mergeMainInvocation(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement value) { - if (((bitField0_ & 0x00000800) == 0x00000800) && - mainInvocation_ != org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance()) { - mainInvocation_ = - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.newBuilder(mainInvocation_).mergeFrom(value).buildPartial(); - } else { - mainInvocation_ = value; - } - - bitField0_ |= 0x00000800; - return this; - } - - /** - * optional .org.jetbrains.kotlin.serialization.js.ast.Statement main_invocation = 12; - */ - public Builder clearMainInvocation() { - mainInvocation_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.Statement.getDefaultInstance(); - - bitField0_ = (bitField0_ & ~0x00000800); - return this; - } - - private void ensureInlinedLocalDeclarationsIsMutable() { - if (!((bitField0_ & 0x00001000) == 0x00001000)) { - inlinedLocalDeclarations_ = new java.util.ArrayList(inlinedLocalDeclarations_); - bitField0_ |= 0x00001000; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public java.util.List getInlinedLocalDeclarationsList() { - return java.util.Collections.unmodifiableList(inlinedLocalDeclarations_); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public int getInlinedLocalDeclarationsCount() { - return inlinedLocalDeclarations_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations getInlinedLocalDeclarations(int index) { - return inlinedLocalDeclarations_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder setInlinedLocalDeclarations( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.set(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder setInlinedLocalDeclarations( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.set(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addInlinedLocalDeclarations(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.add(value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addInlinedLocalDeclarations( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations value) { - if (value == null) { - throw new NullPointerException(); - } - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.add(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addInlinedLocalDeclarations( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.add(builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addInlinedLocalDeclarations( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.InlinedLocalDeclarations.Builder builderForValue) { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.add(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder addAllInlinedLocalDeclarations( - java.lang.Iterable values) { - ensureInlinedLocalDeclarationsIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, inlinedLocalDeclarations_); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder clearInlinedLocalDeclarations() { - inlinedLocalDeclarations_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00001000); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.InlinedLocalDeclarations inlined_local_declarations = 13; - */ - public Builder removeInlinedLocalDeclarations(int index) { - ensureInlinedLocalDeclarationsIsMutable(); - inlinedLocalDeclarations_.remove(index); - - return this; - } - - private void ensureIrClassModelIsMutable() { - if (!((bitField0_ & 0x00002000) == 0x00002000)) { - irClassModel_ = new java.util.ArrayList(irClassModel_); - bitField0_ |= 0x00002000; - } - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public java.util.List getIrClassModelList() { - return java.util.Collections.unmodifiableList(irClassModel_); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public int getIrClassModelCount() { - return irClassModel_.size(); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel getIrClassModel(int index) { - return irClassModel_.get(index); - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public Builder setIrClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel value) { - if (value == null) { - throw new NullPointerException(); - } - ensureIrClassModelIsMutable(); - irClassModel_.set(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public Builder setIrClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.Builder builderForValue) { - ensureIrClassModelIsMutable(); - irClassModel_.set(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public Builder addIrClassModel(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel value) { - if (value == null) { - throw new NullPointerException(); - } - ensureIrClassModelIsMutable(); - irClassModel_.add(value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public Builder addIrClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel value) { - if (value == null) { - throw new NullPointerException(); - } - ensureIrClassModelIsMutable(); - irClassModel_.add(index, value); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public Builder addIrClassModel( - org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.Builder builderForValue) { - ensureIrClassModelIsMutable(); - irClassModel_.add(builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public Builder addIrClassModel( - int index, org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.Builder builderForValue) { - ensureIrClassModelIsMutable(); - irClassModel_.add(index, builderForValue.build()); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public Builder addAllIrClassModel( - java.lang.Iterable values) { - ensureIrClassModelIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, irClassModel_); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public Builder clearIrClassModel() { - irClassModel_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00002000); - - return this; - } - - /** - * repeated .org.jetbrains.kotlin.serialization.js.ast.IrClassModel ir_class_model = 14; - */ - public Builder removeIrClassModel(int index) { - ensureIrClassModelIsMutable(); - irClassModel_.remove(index); - - return this; - } - - /** - * optional string dts = 15; - */ - public boolean hasDts() { - return ((bitField0_ & 0x00004000) == 0x00004000); - } - - /** - * optional string dts = 15; - */ - public java.lang.String getDts() { - java.lang.Object ref = dts_; - if (!(ref instanceof java.lang.String)) { - org.jetbrains.kotlin.protobuf.ByteString bs = - (org.jetbrains.kotlin.protobuf.ByteString) ref; - java.lang.String s = bs.toStringUtf8(); - if (bs.isValidUtf8()) { - dts_ = s; - } - return s; - } else { - return (java.lang.String) ref; - } - } - - /** - * optional string dts = 15; - */ - public Builder setDts( - java.lang.String value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00004000; - dts_ = value; - - return this; - } - - /** - * optional string dts = 15; - */ - public org.jetbrains.kotlin.protobuf.ByteString - getDtsBytes() { - java.lang.Object ref = dts_; - if (ref instanceof String) { - org.jetbrains.kotlin.protobuf.ByteString b = - org.jetbrains.kotlin.protobuf.ByteString.copyFromUtf8( - (java.lang.String) ref); - dts_ = b; - return b; - } else { - return (org.jetbrains.kotlin.protobuf.ByteString) ref; - } - } - - /** - * optional string dts = 15; - */ - public Builder setDtsBytes( - org.jetbrains.kotlin.protobuf.ByteString value) { - if (value == null) { - throw new NullPointerException(); - } - bitField0_ |= 0x00004000; - dts_ = value; - - return this; - } - - /** - * optional string dts = 15; - */ - public Builder clearDts() { - bitField0_ = (bitField0_ & ~0x00004000); - dts_ = getDefaultInstance().getDts(); - - return this; - } - - /** - * optional int32 suite_function = 16; - */ - public boolean hasSuiteFunction() { - return ((bitField0_ & 0x00008000) == 0x00008000); - } - - /** - * optional int32 suite_function = 16; - */ - public int getSuiteFunction() { - return suiteFunction_; - } - - /** - * optional int32 suite_function = 16; - */ - public Builder setSuiteFunction(int value) { - bitField0_ |= 0x00008000; - suiteFunction_ = value; - - return this; - } - - /** - * optional int32 suite_function = 16; - */ - public Builder clearSuiteFunction() { - bitField0_ = (bitField0_ & ~0x00008000); - suiteFunction_ = 0; - - return this; - } - - private void ensureDefinitionsIsMutable() { - if (!((bitField0_ & 0x00010000) == 0x00010000)) { - definitions_ = new java.util.ArrayList(definitions_); - bitField0_ |= 0x00010000; - } - } - /** - * repeated int32 definitions = 17; - */ - public java.util.List - getDefinitionsList() { - return java.util.Collections.unmodifiableList(definitions_); - } - /** - * repeated int32 definitions = 17; - */ - public int getDefinitionsCount() { - return definitions_.size(); - } - /** - * repeated int32 definitions = 17; - */ - public int getDefinitions(int index) { - return definitions_.get(index); - } - /** - * repeated int32 definitions = 17; - */ - public Builder setDefinitions( - int index, int value) { - ensureDefinitionsIsMutable(); - definitions_.set(index, value); - - return this; - } - /** - * repeated int32 definitions = 17; - */ - public Builder addDefinitions(int value) { - ensureDefinitionsIsMutable(); - definitions_.add(value); - - return this; - } - /** - * repeated int32 definitions = 17; - */ - public Builder addAllDefinitions( - java.lang.Iterable values) { - ensureDefinitionsIsMutable(); - org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( - values, definitions_); - - return this; - } - /** - * repeated int32 definitions = 17; - */ - public Builder clearDefinitions() { - definitions_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00010000); - - return this; - } - - // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.Fragment) - } - - // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.Fragment) - } - /** * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.IrClassModel} */ @@ -37071,10 +37382,16 @@ public enum StatementCase } private IrClassModel(boolean noInit) { this.unknownFields = org.jetbrains.kotlin.protobuf.ByteString.EMPTY;} - public static final int NAME_ID_FIELD_NUMBER = 1; - public static final int SUPER_CLASSES_FIELD_NUMBER = 2; - public static final int PRE_DECLARATION_BLOCK_FIELD_NUMBER = 3; - public static final int POST_DECLARATION_BLOCK_FIELD_NUMBER = 4; + private static final IrClassModel defaultInstance; + public static IrClassModel getDefaultInstance() { + return defaultInstance; + } + + public IrClassModel getDefaultInstanceForType() { + return defaultInstance; + } + + private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; private IrClassModel( org.jetbrains.kotlin.protobuf.CodedInputStream input, org.jetbrains.kotlin.protobuf.ExtensionRegistryLite extensionRegistry) @@ -37174,13 +37491,6 @@ public enum StatementCase makeExtensionsImmutable(); } } - private static final IrClassModel defaultInstance; - - @java.lang.Override - public org.jetbrains.kotlin.protobuf.Parser getParserForType() { - return PARSER; - } - private static final long serialVersionUID = 0L; public static org.jetbrains.kotlin.protobuf.Parser PARSER = new org.jetbrains.kotlin.protobuf.AbstractParser() { public IrClassModel parsePartialFrom( @@ -37191,10 +37501,14 @@ public enum StatementCase } }; - static { - defaultInstance = new IrClassModel(true); - defaultInstance.initFields(); + @java.lang.Override + public org.jetbrains.kotlin.protobuf.Parser getParserForType() { + return PARSER; } + + private int bitField0_; + public static final int NAME_ID_FIELD_NUMBER = 1; + private int nameId_; /** * required int32 name_id = 1; */ @@ -37208,8 +37522,8 @@ public enum StatementCase return nameId_; } - private final org.jetbrains.kotlin.protobuf.ByteString unknownFields; - private int bitField0_; + public static final int SUPER_CLASSES_FIELD_NUMBER = 2; + private java.util.List superClasses_; /** * repeated int32 super_classes = 2; */ @@ -37229,8 +37543,9 @@ public enum StatementCase public int getSuperClasses(int index) { return superClasses_.get(index); } - private int nameId_; - private java.util.List superClasses_; + + public static final int PRE_DECLARATION_BLOCK_FIELD_NUMBER = 3; + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock preDeclarationBlock_; /** * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; */ @@ -37243,7 +37558,8 @@ public enum StatementCase public org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock getPreDeclarationBlock() { return preDeclarationBlock_; } - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock preDeclarationBlock_; + + public static final int POST_DECLARATION_BLOCK_FIELD_NUMBER = 4; private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock postDeclarationBlock_; /** * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; @@ -37340,9 +37656,7 @@ public enum StatementCase return size; } - public static IrClassModel getDefaultInstance() { - return defaultInstance; - } + private static final long serialVersionUID = 0L; @java.lang.Override protected java.lang.Object writeReplace() throws java.io.ObjectStreamException { @@ -37409,10 +37723,6 @@ public enum StatementCase } public Builder toBuilder() { return newBuilder(this); } - public IrClassModel getDefaultInstanceForType() { - return defaultInstance; - } - /** * Protobuf type {@code org.jetbrains.kotlin.serialization.js.ast.IrClassModel} */ @@ -37427,7 +37737,8 @@ public enum StatementCase maybeForceBuilderInitialization(); } - private int bitField0_; + private void maybeForceBuilderInitialization() { + } private static Builder create() { return new Builder(); } @@ -37485,10 +37796,52 @@ public enum StatementCase result.bitField0_ = to_bitField0_; return result; } - private int nameId_ ; - private java.util.List superClasses_ = java.util.Collections.emptyList(); - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock preDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); - private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock postDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); + + public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel other) { + if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.getDefaultInstance()) return this; + if (other.hasNameId()) { + setNameId(other.getNameId()); + } + if (!other.superClasses_.isEmpty()) { + if (superClasses_.isEmpty()) { + superClasses_ = other.superClasses_; + bitField0_ = (bitField0_ & ~0x00000002); + } else { + ensureSuperClassesIsMutable(); + superClasses_.addAll(other.superClasses_); + } + + } + if (other.hasPreDeclarationBlock()) { + mergePreDeclarationBlock(other.getPreDeclarationBlock()); + } + if (other.hasPostDeclarationBlock()) { + mergePostDeclarationBlock(other.getPostDeclarationBlock()); + } + setUnknownFields( + getUnknownFields().concat(other.unknownFields)); + return this; + } + + public final boolean isInitialized() { + if (!hasNameId()) { + + return false; + } + if (hasPreDeclarationBlock()) { + if (!getPreDeclarationBlock().isInitialized()) { + + return false; + } + } + if (hasPostDeclarationBlock()) { + if (!getPostDeclarationBlock().isInitialized()) { + + return false; + } + } + return true; + } public Builder mergeFrom( org.jetbrains.kotlin.protobuf.CodedInputStream input, @@ -37507,7 +37860,9 @@ public enum StatementCase } return this; } + private int bitField0_; + private int nameId_ ; /** * required int32 name_id = 1; */ @@ -37520,62 +37875,26 @@ public enum StatementCase public int getNameId() { return nameId_; } - /** * required int32 name_id = 1; */ public Builder setNameId(int value) { bitField0_ |= 0x00000001; nameId_ = value; - + + return this; + } + /** + * required int32 name_id = 1; + */ + public Builder clearNameId() { + bitField0_ = (bitField0_ & ~0x00000001); + nameId_ = 0; + return this; } - public Builder mergeFrom(org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel other) { - if (other == org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.IrClassModel.getDefaultInstance()) return this; - if (other.hasNameId()) { - setNameId(other.getNameId()); - } - if (!other.superClasses_.isEmpty()) { - if (superClasses_.isEmpty()) { - superClasses_ = other.superClasses_; - bitField0_ = (bitField0_ & ~0x00000002); - } else { - ensureSuperClassesIsMutable(); - superClasses_.addAll(other.superClasses_); - } - - } - if (other.hasPreDeclarationBlock()) { - mergePreDeclarationBlock(other.getPreDeclarationBlock()); - } - if (other.hasPostDeclarationBlock()) { - mergePostDeclarationBlock(other.getPostDeclarationBlock()); - } - setUnknownFields( - getUnknownFields().concat(other.unknownFields)); - return this; - } - - public final boolean isInitialized() { - if (!hasNameId()) { - - return false; - } - if (hasPreDeclarationBlock()) { - if (!getPreDeclarationBlock().isInitialized()) { - - return false; - } - } - if (hasPostDeclarationBlock()) { - if (!getPostDeclarationBlock().isInitialized()) { - - return false; - } - } - return true; - } + private java.util.List superClasses_ = java.util.Collections.emptyList(); private void ensureSuperClassesIsMutable() { if (!((bitField0_ & 0x00000002) == 0x00000002)) { superClasses_ = new java.util.ArrayList(superClasses_); @@ -37601,20 +37920,6 @@ public enum StatementCase public int getSuperClasses(int index) { return superClasses_.get(index); } - - private void maybeForceBuilderInitialization() { - } - - /** - * required int32 name_id = 1; - */ - public Builder clearNameId() { - bitField0_ = (bitField0_ & ~0x00000001); - nameId_ = 0; - - return this; - } - /** * repeated int32 super_classes = 2; */ @@ -37622,20 +37927,18 @@ public enum StatementCase int index, int value) { ensureSuperClassesIsMutable(); superClasses_.set(index, value); - + return this; } - /** * repeated int32 super_classes = 2; */ public Builder addSuperClasses(int value) { ensureSuperClassesIsMutable(); superClasses_.add(value); - + return this; } - /** * repeated int32 super_classes = 2; */ @@ -37644,9 +37947,20 @@ public enum StatementCase ensureSuperClassesIsMutable(); org.jetbrains.kotlin.protobuf.AbstractMessageLite.Builder.addAll( values, superClasses_); - + return this; } + /** + * repeated int32 super_classes = 2; + */ + public Builder clearSuperClasses() { + superClasses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000002); + + return this; + } + + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock preDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock pre_declaration_block = 3; */ @@ -37706,15 +38020,7 @@ public enum StatementCase return this; } - /** - * repeated int32 super_classes = 2; - */ - public Builder clearSuperClasses() { - superClasses_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00000002); - - return this; - } + private org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock postDeclarationBlock_ = org.jetbrains.kotlin.serialization.js.ast.JsAstProtoBuf.GlobalBlock.getDefaultInstance(); /** * optional .org.jetbrains.kotlin.serialization.js.ast.GlobalBlock post_declaration_block = 4; */ @@ -37777,6 +38083,11 @@ public enum StatementCase // @@protoc_insertion_point(builder_scope:org.jetbrains.kotlin.serialization.js.ast.IrClassModel) } + static { + defaultInstance = new IrClassModel(true); + defaultInstance.initFields(); + } + // @@protoc_insertion_point(class_scope:org.jetbrains.kotlin.serialization.js.ast.IrClassModel) } diff --git a/js/js.tests/build.gradle.kts b/js/js.tests/build.gradle.kts index 8ed125baa15..3a54b098556 100644 --- a/js/js.tests/build.gradle.kts +++ b/js/js.tests/build.gradle.kts @@ -333,7 +333,8 @@ val runMocha by task { environment.set(mapOf( "KOTLIN_JS_LOCATION" to rootDir.resolve("dist/js/kotlin.js").toString(), - "KOTLIN_JS_TEST_LOCATION" to rootDir.resolve("dist/js/kotlin-test.js").toString() + "KOTLIN_JS_TEST_LOCATION" to rootDir.resolve("dist/js/kotlin-test.js").toString(), + "BOX_FLAG_LOCATION" to rootDir.resolve("compiler/testData/jsBoxFlag.js").toString() )) } diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/RunnerUtils.kt b/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/RunnerUtils.kt index c9d96a19391..6a9a7ad5370 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/RunnerUtils.kt +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/utils/RunnerUtils.kt @@ -132,7 +132,7 @@ fun getAllFilesForRunner( val dceOutputDir = JsEnvironmentConfigurator.getJsArtifactsOutputDir(testServices, TranslationMode.FULL_DCE) val artifactsPaths = modulesToArtifact.values.map { it.outputFile.absolutePath }.filter { !File(it).isDirectory } - val allJsFiles = additionalFiles + inputJsFilesBefore + artifactsPaths + commonFiles + additionalMainFiles + inputJsFilesAfter + val allJsFiles = additionalFiles + inputJsFilesBefore +artifactsPaths + commonFiles + additionalMainFiles + inputJsFilesAfter val result = mutableMapOf(TranslationMode.FULL to allJsFiles) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/BoxJsTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/BoxJsTestGenerated.java index e63ff05d20d..d49f0790206 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/BoxJsTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/BoxJsTestGenerated.java @@ -8137,6 +8137,206 @@ public class BoxJsTestGenerated extends AbstractBoxJsTest { } } + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills") + @TestDataPath("$PROJECT_ROOT") + public class Polyfills { + @Test + public void testAllFilesPresentInPolyfills() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/acosh") + @TestDataPath("$PROJECT_ROOT") + public class Acosh { + @Test + public void testAllFilesPresentInAcosh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/acosh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/asinh") + @TestDataPath("$PROJECT_ROOT") + public class Asinh { + @Test + public void testAllFilesPresentInAsinh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/asinh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/atanh") + @TestDataPath("$PROJECT_ROOT") + public class Atanh { + @Test + public void testAllFilesPresentInAtanh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/atanh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/clz32") + @TestDataPath("$PROJECT_ROOT") + public class Clz32 { + @Test + public void testAllFilesPresentInClz32() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/clz32"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/cosh") + @TestDataPath("$PROJECT_ROOT") + public class Cosh { + @Test + public void testAllFilesPresentInCosh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/cosh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/expm1") + @TestDataPath("$PROJECT_ROOT") + public class Expm1 { + @Test + public void testAllFilesPresentInExpm1() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/expm1"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/fill") + @TestDataPath("$PROJECT_ROOT") + public class Fill { + @Test + public void testAllFilesPresentInFill() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/fill"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/globalThis") + @TestDataPath("$PROJECT_ROOT") + public class GlobalThis { + @Test + public void testAllFilesPresentInGlobalThis() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/globalThis"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/hypot") + @TestDataPath("$PROJECT_ROOT") + public class Hypot { + @Test + public void testAllFilesPresentInHypot() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/hypot"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/imul") + @TestDataPath("$PROJECT_ROOT") + public class Imul { + @Test + public void testAllFilesPresentInImul() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/imul"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/isView") + @TestDataPath("$PROJECT_ROOT") + public class IsView { + @Test + public void testAllFilesPresentInIsView() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/isView"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/log10") + @TestDataPath("$PROJECT_ROOT") + public class Log10 { + @Test + public void testAllFilesPresentInLog10() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/log10"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/log1p") + @TestDataPath("$PROJECT_ROOT") + public class Log1p { + @Test + public void testAllFilesPresentInLog1p() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/log1p"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/log2") + @TestDataPath("$PROJECT_ROOT") + public class Log2 { + @Test + public void testAllFilesPresentInLog2() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/log2"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/sign") + @TestDataPath("$PROJECT_ROOT") + public class Sign { + @Test + public void testAllFilesPresentInSign() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/sign"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/sinh") + @TestDataPath("$PROJECT_ROOT") + public class Sinh { + @Test + public void testAllFilesPresentInSinh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/sinh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/sort") + @TestDataPath("$PROJECT_ROOT") + public class Sort { + @Test + public void testAllFilesPresentInSort() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/sort"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/tanh") + @TestDataPath("$PROJECT_ROOT") + public class Tanh { + @Test + public void testAllFilesPresentInTanh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/tanh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/trunc") + @TestDataPath("$PROJECT_ROOT") + public class Trunc { + @Test + public void testAllFilesPresentInTrunc() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/trunc"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS, true); + } + } + } + @Nested @TestMetadata("js/js.translator/testData/box/propertyAccess") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrBoxJsTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrBoxJsTestGenerated.java index 4bdfa25e0f7..3492859380c 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrBoxJsTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrBoxJsTestGenerated.java @@ -8533,6 +8533,434 @@ public class IrBoxJsTestGenerated extends AbstractIrBoxJsTest { } } + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills") + @TestDataPath("$PROJECT_ROOT") + public class Polyfills { + @Test + public void testAllFilesPresentInPolyfills() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/acosh") + @TestDataPath("$PROJECT_ROOT") + public class Acosh { + @Test + @TestMetadata("acoshWithExistedIntrinsic.kt") + public void testAcoshWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/acosh/acoshWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("acoshWithoutExistedIntrinsic.kt") + public void testAcoshWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/acosh/acoshWithoutExistedIntrinsic.kt"); + } + + @Test + public void testAllFilesPresentInAcosh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/acosh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/asinh") + @TestDataPath("$PROJECT_ROOT") + public class Asinh { + @Test + public void testAllFilesPresentInAsinh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/asinh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("asinhWithExistedIntrinsic.kt") + public void testAsinhWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/asinh/asinhWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("asinhWithoutExistedIntrinsic.kt") + public void testAsinhWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/asinh/asinhWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/atanh") + @TestDataPath("$PROJECT_ROOT") + public class Atanh { + @Test + public void testAllFilesPresentInAtanh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/atanh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("atanhWithExistedIntrinsic.kt") + public void testAtanhWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/atanh/atanhWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("atanhWithoutExistedIntrinsic.kt") + public void testAtanhWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/atanh/atanhWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/clz32") + @TestDataPath("$PROJECT_ROOT") + public class Clz32 { + @Test + public void testAllFilesPresentInClz32() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/clz32"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("clz32WithExistedIntrinsic.kt") + public void testClz32WithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/clz32/clz32WithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("clz32WithoutExistedIntrinsic.kt") + public void testClz32WithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/clz32/clz32WithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/cosh") + @TestDataPath("$PROJECT_ROOT") + public class Cosh { + @Test + public void testAllFilesPresentInCosh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/cosh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("coshWithExistedIntrinsic.kt") + public void testCoshWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/cosh/coshWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("coshWithoutExistedIntrinsic.kt") + public void testCoshWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/cosh/coshWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/expm1") + @TestDataPath("$PROJECT_ROOT") + public class Expm1 { + @Test + public void testAllFilesPresentInExpm1() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/expm1"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("expm1WithExistedIntrinsic.kt") + public void testExpm1WithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/expm1/expm1WithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("expm1WithoutExistedIntrinsic.kt") + public void testExpm1WithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/expm1/expm1WithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/fill") + @TestDataPath("$PROJECT_ROOT") + public class Fill { + @Test + public void testAllFilesPresentInFill() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/fill"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("arrayFillWithExistedIntrinsic.kt") + public void testArrayFillWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/fill/arrayFillWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("arrayFillWithoutExistedIntrinsic.kt") + public void testArrayFillWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/fill/arrayFillWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/globalThis") + @TestDataPath("$PROJECT_ROOT") + public class GlobalThis { + @Test + public void testAllFilesPresentInGlobalThis() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/globalThis"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("globalThisWithExistedIntrinsic.kt") + public void testGlobalThisWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/globalThis/globalThisWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("globalThisWithoutExistedIntrinsic.kt") + public void testGlobalThisWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/globalThis/globalThisWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/hypot") + @TestDataPath("$PROJECT_ROOT") + public class Hypot { + @Test + public void testAllFilesPresentInHypot() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/hypot"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("hypotWithExistedIntrinsic.kt") + public void testHypotWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/hypot/hypotWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("hypotWithoutExistedIntrinsic.kt") + public void testHypotWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/hypot/hypotWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/imul") + @TestDataPath("$PROJECT_ROOT") + public class Imul { + @Test + public void testAllFilesPresentInImul() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/imul"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("imulWithExistedIntrinsic.kt") + public void testImulWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/imul/imulWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("imulWithoutExistedIntrinsic.kt") + public void testImulWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/imul/imulWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/isView") + @TestDataPath("$PROJECT_ROOT") + public class IsView { + @Test + public void testAllFilesPresentInIsView() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/isView"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("isViewWithExistedIntrinsic.kt") + public void testIsViewWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/isView/isViewWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("isViewWithoutExistedIntrinsic.kt") + public void testIsViewWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/isView/isViewWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/log10") + @TestDataPath("$PROJECT_ROOT") + public class Log10 { + @Test + public void testAllFilesPresentInLog10() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/log10"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("log10WithExistedIntrinsic.kt") + public void testLog10WithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/log10/log10WithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("log10WithoutExistedIntrinsic.kt") + public void testLog10WithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/log10/log10WithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/log1p") + @TestDataPath("$PROJECT_ROOT") + public class Log1p { + @Test + public void testAllFilesPresentInLog1p() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/log1p"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("log1pWithExistedIntrinsic.kt") + public void testLog1pWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/log1p/log1pWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("log1pWithoutExistedIntrinsic.kt") + public void testLog1pWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/log1p/log1pWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/log2") + @TestDataPath("$PROJECT_ROOT") + public class Log2 { + @Test + public void testAllFilesPresentInLog2() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/log2"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("log2WithExistedIntrinsic.kt") + public void testLog2WithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/log2/log2WithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("log2WithoutExistedIntrinsic.kt") + public void testLog2WithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/log2/log2WithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/sign") + @TestDataPath("$PROJECT_ROOT") + public class Sign { + @Test + public void testAllFilesPresentInSign() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/sign"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("signWithExistedIntrinsic.kt") + public void testSignWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/sign/signWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("signWithoutExistedIntrinsic.kt") + public void testSignWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/sign/signWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/sinh") + @TestDataPath("$PROJECT_ROOT") + public class Sinh { + @Test + public void testAllFilesPresentInSinh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/sinh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("sinhWithExistedIntrinsic.kt") + public void testSinhWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/sinh/sinhWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("sinhWithoutExistedIntrinsic.kt") + public void testSinhWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/sinh/sinhWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/sort") + @TestDataPath("$PROJECT_ROOT") + public class Sort { + @Test + public void testAllFilesPresentInSort() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/sort"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("sortWithExistedIntrinsic.kt") + public void testSortWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/sort/sortWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("sortWithoutExistedIntrinsic.kt") + public void testSortWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/sort/sortWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/tanh") + @TestDataPath("$PROJECT_ROOT") + public class Tanh { + @Test + public void testAllFilesPresentInTanh() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/tanh"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("tanhWithExistedIntrinsic.kt") + public void testTanhWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/tanh/tanhWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("tanhWithoutExistedIntrinsic.kt") + public void testTanhWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/tanh/tanhWithoutExistedIntrinsic.kt"); + } + } + + @Nested + @TestMetadata("js/js.translator/testData/box/polyfills/trunc") + @TestDataPath("$PROJECT_ROOT") + public class Trunc { + @Test + public void testAllFilesPresentInTrunc() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("js/js.translator/testData/box/polyfills/trunc"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.JS_IR, true); + } + + @Test + @TestMetadata("truncWithExistedIntrinsic.kt") + public void testTruncWithExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/trunc/truncWithExistedIntrinsic.kt"); + } + + @Test + @TestMetadata("truncWithoutExistedIntrinsic.kt") + public void testTruncWithoutExistedIntrinsic() throws Exception { + runTest("js/js.translator/testData/box/polyfills/trunc/truncWithoutExistedIntrinsic.kt"); + } + } + } + @Nested @TestMetadata("js/js.translator/testData/box/propertyAccess") @TestDataPath("$PROJECT_ROOT") diff --git a/js/js.translator/testData/box/polyfills/acosh/acoshWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/acosh/acoshWithExistedIntrinsic.kt new file mode 100644 index 00000000000..545fff481c4 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/acosh/acoshWithExistedIntrinsic.kt @@ -0,0 +1,27 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.acosh = function acosh(x) { + acosh.called = true; + if (x <= 0.5) { + return NaN + } else if (x === 1) { + return 0 + } + return 1.3169578969248166 +} + +// FILE: main.kt +import kotlin.math.acosh + +fun box(): String { + assertEquals(acosh(-1.0), Double.NaN) + assertEquals(acosh(0.0), Double.NaN) + assertEquals(acosh(0.5), Double.NaN) + assertEquals(acosh(1.0), 0.0) + assertEquals(acosh(2.0), 1.3169578969248166) + + assertEquals(js("Math.acosh.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/acosh/acoshWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/acosh/acoshWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..18d24392653 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/acosh/acoshWithoutExistedIntrinsic.kt @@ -0,0 +1,19 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.acosh = undefined; + +// FILE: main.kt +import kotlin.math.acosh + +fun box(): String { + assertEquals(acosh(-1.0), Double.NaN) + assertEquals(acosh(0.0), Double.NaN) + assertEquals(acosh(0.5), Double.NaN) + assertEquals(acosh(1.0), 0.0) + assertEquals(acosh(2.0), 1.3169578969248166) + + assertEquals(js("Math.acosh.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/asinh/asinhWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/asinh/asinhWithExistedIntrinsic.kt new file mode 100644 index 00000000000..127c874ef2e --- /dev/null +++ b/js/js.translator/testData/box/polyfills/asinh/asinhWithExistedIntrinsic.kt @@ -0,0 +1,26 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.asinh = function asinh(x) { + asinh.called = true; + switch (x) { + case -1: return -0.8813735870195429 + case 0: return 0.0 + case 1: return 0.8813735870195429 + case 2: return 1.4436354751788103 + } +} + +// FILE: main.kt +import kotlin.math.asinh + +fun box(): String { + assertEquals(asinh(-1.0), -0.8813735870195429) + assertEquals(asinh(0.0), 0.0) + assertEquals(asinh(1.0), 0.8813735870195429) + assertEquals(asinh(2.0), 1.4436354751788103) + + assertEquals(js("Math.asinh.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/asinh/asinhWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/asinh/asinhWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..3cc78b74a72 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/asinh/asinhWithoutExistedIntrinsic.kt @@ -0,0 +1,18 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.asinh = undefined; + +// FILE: main.kt +import kotlin.math.asinh + +fun box(): String { + assertEquals(asinh(-1.0), -0.8813735870195429) + assertEquals(asinh(0.0), 0.0) + assertEquals(asinh(1.0), 0.8813735870195429) + assertEquals(asinh(2.0), 1.4436354751788103) + + assertEquals(js("Math.asinh.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/atanh/atanhWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/atanh/atanhWithExistedIntrinsic.kt new file mode 100644 index 00000000000..881fe690a5d --- /dev/null +++ b/js/js.translator/testData/box/polyfills/atanh/atanhWithExistedIntrinsic.kt @@ -0,0 +1,26 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.atanh = function atanh(x) { + atanh.called = true; + switch (x) { + case -1: return -Infinity + case 0: return 0.0 + case 0.5: return 0.5493061443340548 + case 1: return Infinity + } +} + +// FILE: main.kt +import kotlin.math.atanh + +fun box(): String { + assertEquals(atanh(-1.0), Double.NEGATIVE_INFINITY) + assertEquals(atanh(0.0), 0.0) + assertEquals(atanh(0.5), 0.5493061443340548) + assertEquals(atanh(1.0), Double.POSITIVE_INFINITY) + + assertEquals(js("Math.atanh.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/atanh/atanhWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/atanh/atanhWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..8f30ae971b0 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/atanh/atanhWithoutExistedIntrinsic.kt @@ -0,0 +1,18 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.atanh = undefined; + +// FILE: main.kt +import kotlin.math.atanh + +fun box(): String { + assertEquals(atanh(-1.0), Double.NEGATIVE_INFINITY) + assertEquals(atanh(0.0), 0.0) + assertEquals(atanh(0.5), 0.5493061443340548) + assertEquals(atanh(1.0), Double.POSITIVE_INFINITY) + + assertEquals(js("Math.atanh.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/clz32/clz32WithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/clz32/clz32WithExistedIntrinsic.kt new file mode 100644 index 00000000000..6ed4edddb35 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/clz32/clz32WithExistedIntrinsic.kt @@ -0,0 +1,21 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.clz32 = function clz32(x) { + clz32.called = true; + var asUint = x >>> 0; + if (asUint === 0) { + return 32; + } + return 31 - (Math.log(asUint) / Math.LN2 | 0) | 0; // the "| 0" acts like math.floor +} + +// FILE: main.kt +fun box(): String { + val result = 4.countLeadingZeroBits() + + assertEquals(result, 29) + assertEquals(js("Math.clz32.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/clz32/clz32WithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/clz32/clz32WithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..6194c5376d3 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/clz32/clz32WithoutExistedIntrinsic.kt @@ -0,0 +1,14 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.clz32 = undefined; + +// FILE: main.kt +fun box(): String { + val result = 4.countLeadingZeroBits() + + assertEquals(result, 29) + assertEquals(js("Math.clz32.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/cosh/coshWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/cosh/coshWithExistedIntrinsic.kt new file mode 100644 index 00000000000..a443194a61a --- /dev/null +++ b/js/js.translator/testData/box/polyfills/cosh/coshWithExistedIntrinsic.kt @@ -0,0 +1,26 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.cosh = function cosh(x) { + cosh.called = true; + switch (x) { + case -1: return 1.5430806348152437 + case 0: return 1.0 + case 1: return 1.5430806348152437 + case 2: return 3.7621956910836314 + } +} + +// FILE: main.kt +import kotlin.math.cosh + +fun box(): String { + assertEquals(cosh(-1.0), 1.5430806348152437) + assertEquals(cosh(0.0), 1.0) + assertEquals(cosh(1.0), 1.5430806348152437) + assertEquals(cosh(2.0), 3.7621956910836314) + + assertEquals(js("Math.cosh.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/cosh/coshWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/cosh/coshWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..42c45864f6b --- /dev/null +++ b/js/js.translator/testData/box/polyfills/cosh/coshWithoutExistedIntrinsic.kt @@ -0,0 +1,18 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.cosh = undefined; + +// FILE: main.kt +import kotlin.math.cosh + +fun box(): String { + assertEquals(cosh(-1.0), 1.5430806348152437) + assertEquals(cosh(0.0), 1.0) + assertEquals(cosh(1.0), 1.5430806348152437) + assertEquals(cosh(2.0), 3.7621956910836314) + + assertEquals(js("Math.cosh.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/expm1/expm1WithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/expm1/expm1WithExistedIntrinsic.kt new file mode 100644 index 00000000000..f133c08e518 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/expm1/expm1WithExistedIntrinsic.kt @@ -0,0 +1,26 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.expm1 = function expm1(x) { + expm1.called = true; + switch (x) { + case -1: return -0.6321205588285577 + case 0: return 0.0 + case 1: return 1.718281828459045 + case 2: return 6.38905609893065 + } +} + +// FILE: main.kt +import kotlin.math.expm1 + +fun box(): String { + assertEquals(expm1(-1.0), -0.6321205588285577) + assertEquals(expm1(0.0), 0.0) + assertEquals(expm1(1.0), 1.718281828459045) + assertEquals(expm1(2.0), 6.38905609893065) + + assertEquals(js("Math.expm1.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/expm1/expm1WithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/expm1/expm1WithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..09d38091f16 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/expm1/expm1WithoutExistedIntrinsic.kt @@ -0,0 +1,18 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.expm1 = undefined; + +// FILE: main.kt +import kotlin.math.expm1 + +fun box(): String { + assertEquals(expm1(-1.0), -0.6321205588285577) + assertEquals(expm1(0.0), 0.0) + assertEquals(expm1(1.0), 1.718281828459045) + assertEquals(expm1(2.0), 6.38905609893065) + + assertEquals(js("Math.expm1.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/fill/arrayFillWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/fill/arrayFillWithExistedIntrinsic.kt new file mode 100644 index 00000000000..1ea2e97d5cc --- /dev/null +++ b/js/js.translator/testData/box/polyfills/fill/arrayFillWithExistedIntrinsic.kt @@ -0,0 +1,20 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Int32Array.prototype.fill = function fill(value) { + fill.called = true; + for (var i = 0; i < this.length; i++) { + this[i] = value; + } + return this +} + +// FILE: main.kt +fun box(): String { + val int = IntArray(4).apply { fill(42) } + + assertEquals(int.joinToString(", "), "42, 42, 42, 42") + assertEquals(js("Int32Array.prototype.fill.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/fill/arrayFillWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/fill/arrayFillWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..7d0e68d7441 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/fill/arrayFillWithoutExistedIntrinsic.kt @@ -0,0 +1,14 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Int32Array.prototype.fill = undefined; + +// FILE: main.kt +fun box(): String { + val int = IntArray(4).apply { fill(42) } + + assertEquals(int.joinToString(", "), "42, 42, 42, 42") + assertEquals(js("Int32Array.prototype.fill.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/globalThis/globalThisWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/globalThis/globalThisWithExistedIntrinsic.kt new file mode 100644 index 00000000000..9a058a227a3 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/globalThis/globalThisWithExistedIntrinsic.kt @@ -0,0 +1,12 @@ +// !LANGUAGE: +JsAllowInvalidCharsIdentifiersEscaping +// TARGET_BACKEND: JS_IR +// FILE: main.js +this.globalThis = { "Is Just Created Global This": true } + +// FILE: main.kt +external val `Is Just Created Global This`: Boolean + +fun box(): String { + assertEquals(`Is Just Created Global This`, true) + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/globalThis/globalThisWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/globalThis/globalThisWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..dc1b9dbdfb0 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/globalThis/globalThisWithoutExistedIntrinsic.kt @@ -0,0 +1,13 @@ +// !LANGUAGE: +JsAllowInvalidCharsIdentifiersEscaping +// TARGET_BACKEND: JS_IR +// FILE: main.js +this.globalThis = undefined +this["Is Just Created Global This"] = true + +// FILE: main.kt +external val `Is Just Created Global This`: Boolean + +fun box(): String { + assertEquals(`Is Just Created Global This`, true) + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/hypot/hypotWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/hypot/hypotWithExistedIntrinsic.kt new file mode 100644 index 00000000000..6f72a4d7a14 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/hypot/hypotWithExistedIntrinsic.kt @@ -0,0 +1,19 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.hypot = function hypot(a, b) { + hypot.called = true; + return Math.sqrt(a*a + b*b) +} + +// FILE: main.kt +import kotlin.math.hypot + +fun box(): String { + assertEquals(hypot(3.0, 4.0), 5.0) + assertEquals(hypot(5.0, 12.0), 13.0) + assertEquals(hypot(-5.0, 0.0), 5.0) + assertEquals(js("Math.hypot.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/hypot/hypotWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/hypot/hypotWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..d6ed13c02ed --- /dev/null +++ b/js/js.translator/testData/box/polyfills/hypot/hypotWithoutExistedIntrinsic.kt @@ -0,0 +1,16 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.hypot = undefined; + +// FILE: main.kt +import kotlin.math.hypot + +fun box(): String { + assertEquals(hypot(3.0, 4.0), 5.0) + assertEquals(hypot(5.0, 12.0), 13.0) + assertEquals(hypot(-5.0, 0.0), 5.0) + assertEquals(js("Math.hypot.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/imul/imulWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/imul/imulWithExistedIntrinsic.kt new file mode 100644 index 00000000000..8a0f5f01af6 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/imul/imulWithExistedIntrinsic.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.imul = function imul(a, b) { + imul.called = true; + return a * b +} + +// FILE: main.kt +fun box(): String { + val a: Int = 2 + val b: Int = 42 + val c: Int = a * b + + assertEquals(c, 84) + assertEquals(js("Math.imul.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/imul/imulWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/imul/imulWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..015d0f8ba7c --- /dev/null +++ b/js/js.translator/testData/box/polyfills/imul/imulWithoutExistedIntrinsic.kt @@ -0,0 +1,18 @@ +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.imul = undefined; + +// FILE: main.kt +fun box(): String { + val a: Int = 2 + val b: Int = 42 + val c: Int = 44 + val d: Int = -2 + + assertEquals(a * b, 84) + assertEquals(a * c, 88) + assertEquals(a * d, -4) + assertEquals(js("Math.imul.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/isView/isViewWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/isView/isViewWithExistedIntrinsic.kt new file mode 100644 index 00000000000..c32b521863f --- /dev/null +++ b/js/js.translator/testData/box/polyfills/isView/isViewWithExistedIntrinsic.kt @@ -0,0 +1,18 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +ArrayBuffer.isView = function isView(a) { + isView.called = true; + return a != null && a.__proto__ != null && a.__proto__.__proto__ === Int8Array.prototype.__proto__; +} + +// FILE: main.kt +fun box(): String { + val intArr = intArrayOf(5, 4, 3, 2, 1) + val result = IntArray(5).apply { intArr.copyInto(this) } + + assertEquals(result.joinToString(","), intArr.joinToString(",")) + assertEquals(js("ArrayBuffer.isView.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/isView/isViewWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/isView/isViewWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..b1624e26a66 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/isView/isViewWithoutExistedIntrinsic.kt @@ -0,0 +1,15 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +ArrayBuffer.isView = undefined; + +// FILE: main.kt +fun box(): String { + val intArr = intArrayOf(5, 4, 3, 2, 1) + val result = IntArray(5).apply { intArr.copyInto(this) } + + assertEquals(result.joinToString(","), intArr.joinToString(",")) + assertEquals(js("ArrayBuffer.isView.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/log10/log10WithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/log10/log10WithExistedIntrinsic.kt new file mode 100644 index 00000000000..47f0c2854c3 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/log10/log10WithExistedIntrinsic.kt @@ -0,0 +1,19 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.log10 = function log10(x) { + log10.called = true; + return Math.log(x) * Math.LOG10E; +} + +// FILE: main.kt +import kotlin.math.log10 + +fun box(): String { + assertEquals(log10(1.0), 0) + assertEquals(log10(10.0), 1) + assertEquals(log10(100.0), 2) + assertEquals(js("Math.log10.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/log10/log10WithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/log10/log10WithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..6618f22b67d --- /dev/null +++ b/js/js.translator/testData/box/polyfills/log10/log10WithoutExistedIntrinsic.kt @@ -0,0 +1,16 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.log10 = undefined; + +// FILE: main.kt +import kotlin.math.log10 + +fun box(): String { + assertEquals(log10(1.0), 0) + assertEquals(log10(10.0), 1) + assertEquals(log10(100.0), 2) + assertEquals(js("Math.log10.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/log1p/log1pWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/log1p/log1pWithExistedIntrinsic.kt new file mode 100644 index 00000000000..aca893a8fa8 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/log1p/log1pWithExistedIntrinsic.kt @@ -0,0 +1,25 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.log1p = function log1p(x) { + log1p.called = true; + switch (x) { + case -2: return NaN + case -1: return -Infinity + case 0: return 0 + case 1: return 0.6931471805599453 + } +} + +// FILE: main.kt +import kotlin.math.ln1p + +fun box(): String { + assertEquals(ln1p(-2.0), Double.NaN) + assertEquals(ln1p(-1.0), Double.NEGATIVE_INFINITY) + assertEquals(ln1p(0.0), 0.0) + assertEquals(ln1p(1.0), 0.6931471805599453) + assertEquals(js("Math.log1p.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/log1p/log1pWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/log1p/log1pWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..26c959ac0d2 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/log1p/log1pWithoutExistedIntrinsic.kt @@ -0,0 +1,17 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.log1p = undefined; + +// FILE: main.kt +import kotlin.math.ln1p + +fun box(): String { + assertEquals(ln1p(-2.0), Double.NaN) + assertEquals(ln1p(-1.0), Double.NEGATIVE_INFINITY) + assertEquals(ln1p(0.0), 0.0) + assertEquals(ln1p(1.0), 0.6931471805599453) + assertEquals(js("Math.log1p.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/log2/log2WithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/log2/log2WithExistedIntrinsic.kt new file mode 100644 index 00000000000..be653185865 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/log2/log2WithExistedIntrinsic.kt @@ -0,0 +1,19 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.log2 = function log2(x) { + log2.called = true; + return Math.log(x) * Math.LOG2E; +} + +// FILE: main.kt +import kotlin.math.log2 + +fun box(): String { + assertEquals(log2(1.0), 0) + assertEquals(log2(2.0), 1) + assertEquals(log2(4.0), 2) + assertEquals(js("Math.log2.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/log2/log2WithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/log2/log2WithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..867bcdd1b37 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/log2/log2WithoutExistedIntrinsic.kt @@ -0,0 +1,16 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.log2 = undefined; + +// FILE: main.kt +import kotlin.math.log2 + +fun box(): String { + assertEquals(log2(1.0), 0) + assertEquals(log2(2.0), 1) + assertEquals(log2(4.0), 2) + assertEquals(js("Math.log2.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/sign/signWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/sign/signWithExistedIntrinsic.kt new file mode 100644 index 00000000000..471bcdb9d44 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/sign/signWithExistedIntrinsic.kt @@ -0,0 +1,19 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.sign = function sign(x) { + sign.called = true; + return x > 0 ? 1 : -1; +} + +// FILE: main.kt +import kotlin.math.sign + +fun box(): String { + val result = 44.0.sign + + assertEquals(result, 1) + assertEquals(js("Math.sign.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/sign/signWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/sign/signWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..1f95583d571 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/sign/signWithoutExistedIntrinsic.kt @@ -0,0 +1,16 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.sign = undefined; + +// FILE: main.kt +import kotlin.math.sign + +fun box(): String { + val result = 44.0.sign + + assertEquals(result, 1) + assertEquals(js("Math.sign.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/sinh/sinhWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/sinh/sinhWithExistedIntrinsic.kt new file mode 100644 index 00000000000..59d1446280e --- /dev/null +++ b/js/js.translator/testData/box/polyfills/sinh/sinhWithExistedIntrinsic.kt @@ -0,0 +1,26 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.sinh = function sinh(x) { + sinh.called = true; + switch (x) { + case -1: return -1.1752011936438014 + case 0: return 0 + case 1: return 1.1752011936438014 + case 2: return 3.626860407847019 + } +} + +// FILE: main.kt +import kotlin.math.sinh + +fun box(): String { + assertEquals(sinh(-1.0), -1.1752011936438014) + assertEquals(sinh(0.0), 0.0) + assertEquals(sinh(1.0), 1.1752011936438014) + assertEquals(sinh(2.0), 3.626860407847019) + + assertEquals(js("Math.sinh.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/sinh/sinhWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/sinh/sinhWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..61710604239 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/sinh/sinhWithoutExistedIntrinsic.kt @@ -0,0 +1,18 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.sinh = undefined; + +// FILE: main.kt +import kotlin.math.sinh + +fun box(): String { + assertEquals(sinh(-1.0), -1.1752011936438014) + assertEquals(sinh(0.0), 0.0) + assertEquals(sinh(1.0), 1.1752011936438014) + assertEquals(sinh(2.0), 3.626860407847019) + + assertEquals(js("Math.sinh.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/sort/sortWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/sort/sortWithExistedIntrinsic.kt new file mode 100644 index 00000000000..fdf59f9dfe7 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/sort/sortWithExistedIntrinsic.kt @@ -0,0 +1,18 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Int32Array.prototype.sort = function sort(compareFunction) { + sort.called = true; + return Array.prototype.sort.call(this, compareFunction); +} + +// FILE: main.kt +fun box(): String { + val intArr = intArrayOf(5, 4, 3, 2, 1) + .apply { sort { a, b -> a - b } } + + assertEquals(intArr.joinToString(","), "1,2,3,4,5") + assertEquals(js("Int32Array.prototype.sort.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/sort/sortWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/sort/sortWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..26fd521c57c --- /dev/null +++ b/js/js.translator/testData/box/polyfills/sort/sortWithoutExistedIntrinsic.kt @@ -0,0 +1,15 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Int32Array.prototype.sort = undefined; + +// FILE: main.kt +fun box(): String { + val intArr = intArrayOf(5, 4, 3, 2, 1) + .apply { sort { a, b -> a - b } } + + assertEquals(intArr.joinToString(","), "1,2,3,4,5") + assertEquals(js("Int32Array.prototype.sort.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/tanh/tanhWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/tanh/tanhWithExistedIntrinsic.kt new file mode 100644 index 00000000000..60b508a8506 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/tanh/tanhWithExistedIntrinsic.kt @@ -0,0 +1,26 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.tanh = function tanh(x) { + tanh.called = true; + switch (x) { + case -1: return -0.7615941559557649 + case 0: return 0 + case 1: return 0.7615941559557649 + case Infinity: return 1 + } +} + +// FILE: main.kt +import kotlin.math.tanh + +fun box(): String { + assertEquals(tanh(-1.0), -0.7615941559557649) + assertEquals(tanh(0.0), 0.0) + assertEquals(tanh(1.0), 0.7615941559557649) + assertEquals(tanh(Double.POSITIVE_INFINITY), 1.0) + + assertEquals(js("Math.tanh.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/tanh/tanhWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/tanh/tanhWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..3ac56de9ef8 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/tanh/tanhWithoutExistedIntrinsic.kt @@ -0,0 +1,17 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.tanh = undefined; + +// FILE: main.kt +import kotlin.math.tanh + +fun box(): String { + assertEquals(tanh(-1.0), -0.7615941559557649) + assertEquals(tanh(0.0), 0.0) + assertEquals(tanh(1.0), 0.7615941559557649) + assertEquals(tanh(Double.POSITIVE_INFINITY), 1.0) + assertEquals(js("Math.tanh.called"), js("undefined")) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/trunc/truncWithExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/trunc/truncWithExistedIntrinsic.kt new file mode 100644 index 00000000000..ca4dd1b47d3 --- /dev/null +++ b/js/js.translator/testData/box/polyfills/trunc/truncWithExistedIntrinsic.kt @@ -0,0 +1,25 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.trunc = function trunc(x) { + trunc.called = true; + if (isNaN(x)) { + return NaN; + } + if (x > 0) { + return Math.floor(x); + } + return Math.ceil(x); +} + +// FILE: main.kt +import kotlin.math.truncate + +fun box(): String { + val result = truncate(1.188) + + assertEquals(result, 1) + assertEquals(js("Math.trunc.called"), true) + + return "OK" +} diff --git a/js/js.translator/testData/box/polyfills/trunc/truncWithoutExistedIntrinsic.kt b/js/js.translator/testData/box/polyfills/trunc/truncWithoutExistedIntrinsic.kt new file mode 100644 index 00000000000..1ce6aeea1cd --- /dev/null +++ b/js/js.translator/testData/box/polyfills/trunc/truncWithoutExistedIntrinsic.kt @@ -0,0 +1,16 @@ +// WITH_STDLIB +// TARGET_BACKEND: JS_IR +// FILE: main.js +Math.trunc = undefined; + +// FILE: main.kt +import kotlin.math.truncate + +fun box(): String { + val result = truncate(1.188) + + assertEquals(result, 1) + assertEquals(js("Math.trunc.called"), js("undefined")) + + return "OK" +} diff --git a/libraries/stdlib/js-ir/runtime/globalThis.kt b/libraries/stdlib/js-ir/runtime/globalThis.kt index cafb01ad109..b44be9ec607 100644 --- a/libraries/stdlib/js-ir/runtime/globalThis.kt +++ b/libraries/stdlib/js-ir/runtime/globalThis.kt @@ -5,7 +5,7 @@ package kotlin.js -@JsNativeImplementation(""" +@JsPolyfill(""" (function() { if (typeof globalThis === 'object') return; Object.defineProperty(Object.prototype, '__magic__', { diff --git a/libraries/stdlib/js-ir/runtime/math.kt b/libraries/stdlib/js-ir/runtime/math.kt index 9792710078b..b929ec0cf1f 100644 --- a/libraries/stdlib/js-ir/runtime/math.kt +++ b/libraries/stdlib/js-ir/runtime/math.kt @@ -5,8 +5,8 @@ @file:JsQualifier("Math") package kotlin.js -@JsNativeImplementation(""" -if (typeof Math == "object" && Math !== null & typeof Math.imul === "undefined") { +@JsPolyfill(""" +if (typeof Math.imul === "undefined") { Math.imul = function imul(a, b) { return ((a & 0xffff0000) * (b & 0xffff) + (a & 0xffff) * (b | 0)) | 0; } diff --git a/libraries/stdlib/js-ir/runtime/typeCheckUtils.kt b/libraries/stdlib/js-ir/runtime/typeCheckUtils.kt index 493c51bc015..4a67a7efd89 100644 --- a/libraries/stdlib/js-ir/runtime/typeCheckUtils.kt +++ b/libraries/stdlib/js-ir/runtime/typeCheckUtils.kt @@ -142,9 +142,7 @@ internal fun isArray(obj: Any): Boolean { return isJsArray(obj) && !(obj.asDynamic().`$type$`) } -internal fun isArrayish(o: dynamic) = - isJsArray(o) || js("ArrayBuffer").isView(o).unsafeCast() - +internal fun isArrayish(o: dynamic) = isJsArray(o) || arrayBufferIsView(o) internal fun isChar(@Suppress("UNUSED_PARAMETER") c: Any): Boolean { error("isChar is not implemented") diff --git a/libraries/stdlib/js-ir/src/generated/_ArraysJs.kt b/libraries/stdlib/js-ir/src/generated/_ArraysJs.kt index 267ea4c0f8b..d508cfabd46 100644 --- a/libraries/stdlib/js-ir/src/generated/_ArraysJs.kt +++ b/libraries/stdlib/js-ir/src/generated/_ArraysJs.kt @@ -1434,7 +1434,7 @@ public actual fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun Array.fill(element: T, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1450,7 +1450,7 @@ public actual fun Array.fill(element: T, fromIndex: Int = 0, toIndex: Int @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun ByteArray.fill(element: Byte, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1466,7 +1466,7 @@ public actual fun ByteArray.fill(element: Byte, fromIndex: Int = 0, toIndex: Int @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1482,7 +1482,7 @@ public actual fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: I @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun IntArray.fill(element: Int, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1498,7 +1498,7 @@ public actual fun IntArray.fill(element: Int, fromIndex: Int = 0, toIndex: Int = @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun LongArray.fill(element: Long, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1514,7 +1514,7 @@ public actual fun LongArray.fill(element: Long, fromIndex: Int = 0, toIndex: Int @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun FloatArray.fill(element: Float, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1530,7 +1530,7 @@ public actual fun FloatArray.fill(element: Float, fromIndex: Int = 0, toIndex: I @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun DoubleArray.fill(element: Double, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1546,7 +1546,7 @@ public actual fun DoubleArray.fill(element: Double, fromIndex: Int = 0, toIndex: @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun BooleanArray.fill(element: Boolean, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1562,7 +1562,7 @@ public actual fun BooleanArray.fill(element: Boolean, fromIndex: Int = 0, toInde @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun CharArray.fill(element: Char, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1805,7 +1805,7 @@ public actual inline fun Array.plusElement(element: T): Array { * @sample samples.collections.Arrays.Sorting.sortArray */ public actual fun IntArray.sort(): Unit { - this.asDynamic().sort() + nativeSort() } /** @@ -1824,7 +1824,7 @@ public actual fun LongArray.sort(): Unit { * @sample samples.collections.Arrays.Sorting.sortArray */ public actual fun ByteArray.sort(): Unit { - this.asDynamic().sort() + nativeSort() } /** @@ -1833,7 +1833,7 @@ public actual fun ByteArray.sort(): Unit { * @sample samples.collections.Arrays.Sorting.sortArray */ public actual fun ShortArray.sort(): Unit { - this.asDynamic().sort() + nativeSort() } /** @@ -1842,7 +1842,7 @@ public actual fun ShortArray.sort(): Unit { * @sample samples.collections.Arrays.Sorting.sortArray */ public actual fun DoubleArray.sort(): Unit { - this.asDynamic().sort() + nativeSort() } /** @@ -1851,7 +1851,7 @@ public actual fun DoubleArray.sort(): Unit { * @sample samples.collections.Arrays.Sorting.sortArray */ public actual fun FloatArray.sort(): Unit { - this.asDynamic().sort() + nativeSort() } /** @@ -1860,7 +1860,7 @@ public actual fun FloatArray.sort(): Unit { * @sample samples.collections.Arrays.Sorting.sortArray */ public actual fun CharArray.sort(): Unit { - this.asDynamic().sort(::primitiveCompareTo) + nativeSort(::primitiveCompareTo) } /** @@ -2043,7 +2043,7 @@ public actual fun CharArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun ByteArray.sort(noinline comparison: (a: Byte, b: Byte) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2053,7 +2053,7 @@ public inline fun ByteArray.sort(noinline comparison: (a: Byte, b: Byte) -> Int) @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun ShortArray.sort(noinline comparison: (a: Short, b: Short) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2063,7 +2063,7 @@ public inline fun ShortArray.sort(noinline comparison: (a: Short, b: Short) -> I @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun IntArray.sort(noinline comparison: (a: Int, b: Int) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2073,7 +2073,7 @@ public inline fun IntArray.sort(noinline comparison: (a: Int, b: Int) -> Int): U @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun LongArray.sort(noinline comparison: (a: Long, b: Long) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2083,7 +2083,7 @@ public inline fun LongArray.sort(noinline comparison: (a: Long, b: Long) -> Int) @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun FloatArray.sort(noinline comparison: (a: Float, b: Float) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2093,7 +2093,7 @@ public inline fun FloatArray.sort(noinline comparison: (a: Float, b: Float) -> I @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2103,7 +2103,7 @@ public inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) - @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun CharArray.sort(noinline comparison: (a: Char, b: Char) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** diff --git a/libraries/stdlib/js/src/generated/_ArraysJs.kt b/libraries/stdlib/js/src/generated/_ArraysJs.kt index ab2349fd28c..fe815c3e01e 100644 --- a/libraries/stdlib/js/src/generated/_ArraysJs.kt +++ b/libraries/stdlib/js/src/generated/_ArraysJs.kt @@ -1464,7 +1464,7 @@ public actual fun CharArray.copyOfRange(fromIndex: Int, toIndex: Int): CharArray @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun Array.fill(element: T, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1480,7 +1480,7 @@ public actual fun Array.fill(element: T, fromIndex: Int = 0, toIndex: Int @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun ByteArray.fill(element: Byte, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1496,7 +1496,7 @@ public actual fun ByteArray.fill(element: Byte, fromIndex: Int = 0, toIndex: Int @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1512,7 +1512,7 @@ public actual fun ShortArray.fill(element: Short, fromIndex: Int = 0, toIndex: I @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun IntArray.fill(element: Int, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1528,7 +1528,7 @@ public actual fun IntArray.fill(element: Int, fromIndex: Int = 0, toIndex: Int = @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun LongArray.fill(element: Long, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1544,7 +1544,7 @@ public actual fun LongArray.fill(element: Long, fromIndex: Int = 0, toIndex: Int @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun FloatArray.fill(element: Float, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1560,7 +1560,7 @@ public actual fun FloatArray.fill(element: Float, fromIndex: Int = 0, toIndex: I @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun DoubleArray.fill(element: Double, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1576,7 +1576,7 @@ public actual fun DoubleArray.fill(element: Double, fromIndex: Int = 0, toIndex: @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun BooleanArray.fill(element: Boolean, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -1592,7 +1592,7 @@ public actual fun BooleanArray.fill(element: Boolean, fromIndex: Int = 0, toInde @Suppress("ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS") public actual fun CharArray.fill(element: Char, fromIndex: Int = 0, toIndex: Int = size): Unit { AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); } /** @@ -2062,7 +2062,7 @@ public actual fun CharArray.sort(fromIndex: Int = 0, toIndex: Int = size): Unit @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun ByteArray.sort(noinline comparison: (a: Byte, b: Byte) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2072,7 +2072,7 @@ public inline fun ByteArray.sort(noinline comparison: (a: Byte, b: Byte) -> Int) @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun ShortArray.sort(noinline comparison: (a: Short, b: Short) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2082,7 +2082,7 @@ public inline fun ShortArray.sort(noinline comparison: (a: Short, b: Short) -> I @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun IntArray.sort(noinline comparison: (a: Int, b: Int) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2092,7 +2092,7 @@ public inline fun IntArray.sort(noinline comparison: (a: Int, b: Int) -> Int): U @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun LongArray.sort(noinline comparison: (a: Long, b: Long) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2102,7 +2102,7 @@ public inline fun LongArray.sort(noinline comparison: (a: Long, b: Long) -> Int) @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun FloatArray.sort(noinline comparison: (a: Float, b: Float) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2112,7 +2112,7 @@ public inline fun FloatArray.sort(noinline comparison: (a: Float, b: Float) -> I @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** @@ -2122,7 +2122,7 @@ public inline fun DoubleArray.sort(noinline comparison: (a: Double, b: Double) - @DeprecatedSinceKotlin(warningSince = "1.6") @kotlin.internal.InlineOnly public inline fun CharArray.sort(noinline comparison: (a: Char, b: Char) -> Int): Unit { - asDynamic().sort(comparison) + nativeSort(comparison) } /** diff --git a/libraries/stdlib/js/src/kotlin/ArrayBuffer.kt b/libraries/stdlib/js/src/kotlin/ArrayBuffer.kt new file mode 100644 index 00000000000..90e58f36500 --- /dev/null +++ b/libraries/stdlib/js/src/kotlin/ArrayBuffer.kt @@ -0,0 +1,17 @@ +/* + * Copyright 2010-2021 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. + */ + +@file:JsQualifier("ArrayBuffer") +package kotlin.js + +@JsName("isView") +@JsPolyfill(""" +if (typeof ArrayBuffer.isView === "undefined") { + ArrayBuffer.isView = function(a) { + return a != null && a.__proto__ != null && a.__proto__.__proto__ === Int8Array.prototype.__proto__; + }; +} +""") +internal external fun arrayBufferIsView(value: Any?): Boolean \ No newline at end of file diff --git a/libraries/stdlib/js/src/kotlin/collections.kt b/libraries/stdlib/js/src/kotlin/collections.kt index a3882d1f3ef..406979519c5 100644 --- a/libraries/stdlib/js/src/kotlin/collections.kt +++ b/libraries/stdlib/js/src/kotlin/collections.kt @@ -7,6 +7,7 @@ package kotlin.collections import kotlin.comparisons.naturalOrder import kotlin.random.Random +import kotlin.js.arrayBufferIsView /** * Returns the array if it's not `null`, or an empty array otherwise. @@ -193,7 +194,7 @@ internal fun arrayCopy(source: Array, destination: Array, desti val rangeSize = endIndex - startIndex AbstractList.checkRangeIndexes(destinationOffset, destinationOffset + rangeSize, destination.size) - if (js("ArrayBuffer").isView(destination) && js("ArrayBuffer").isView(source)) { + if (arrayBufferIsView(destination) && arrayBufferIsView(source)) { val subrange = source.asDynamic().subarray(startIndex, endIndex) destination.asDynamic().set(subrange, destinationOffset) } else { diff --git a/libraries/stdlib/js/src/kotlin/internalAnnotations.kt b/libraries/stdlib/js/src/kotlin/internalAnnotations.kt index 3cf64c2f2f2..486e83f28f5 100644 --- a/libraries/stdlib/js/src/kotlin/internalAnnotations.kt +++ b/libraries/stdlib/js/src/kotlin/internalAnnotations.kt @@ -7,4 +7,4 @@ package kotlin.js @Retention(AnnotationRetention.BINARY) @Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY) -internal annotation class JsNativeImplementation(val implementation: String) +internal annotation class JsPolyfill(val implementation: String) diff --git a/libraries/stdlib/js/src/kotlin/js.arrays/fill.kt b/libraries/stdlib/js/src/kotlin/js.arrays/fill.kt new file mode 100644 index 00000000000..44a2188a2b3 --- /dev/null +++ b/libraries/stdlib/js/src/kotlin/js.arrays/fill.kt @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2021 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 kotlin.js + +@PublishedApi +@Suppress("NOTHING_TO_INLINE") +@JsPolyfill(""" +if (typeof Array.prototype.fill === "undefined") { + // Polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/fill#Polyfill + Object.defineProperty(Array.prototype, 'fill', { + value: function (value) { + // Steps 1-2. + if (this == null) { + throw new TypeError('this is null or not defined'); + } + + var O = Object(this); + + // Steps 3-5. + var len = O.length >>> 0; + + // Steps 6-7. + var start = arguments[1]; + var relativeStart = start >> 0; + + // Step 8. + var k = relativeStart < 0 ? + Math.max(len + relativeStart, 0) : + Math.min(relativeStart, len); + + // Steps 9-10. + var end = arguments[2]; + var relativeEnd = end === undefined ? + len : end >> 0; + + // Step 11. + var finalValue = relativeEnd < 0 ? + Math.max(len + relativeEnd, 0) : + Math.min(relativeEnd, len); + + // Step 12. + while (k < finalValue) { + O[k] = value; + k++; + } + + // Step 13. + return O; + } + }); +} + +[Int8Array, Int16Array, Uint16Array, Int32Array, Float32Array, Float64Array].forEach(function (TypedArray) { + if (typeof TypedArray.prototype.fill === "undefined") { + Object.defineProperty(TypedArray.prototype, 'fill', { + value: Array.prototype.fill + }); + } +}) +""") +internal inline fun Any.nativeFill(element: Any?, fromIndex: Int, toIndex: Int): Unit { + asDynamic().fill(element, fromIndex, toIndex) +} diff --git a/libraries/stdlib/js/src/kotlin/js.arrays/sort.kt b/libraries/stdlib/js/src/kotlin/js.arrays/sort.kt new file mode 100644 index 00000000000..07c565ff6d6 --- /dev/null +++ b/libraries/stdlib/js/src/kotlin/js.arrays/sort.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2021 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 kotlin.js + +@PublishedApi +@Suppress("NOTHING_TO_INLINE") +@JsPolyfill(""" +[Int8Array, Int16Array, Uint16Array, Int32Array, Float32Array, Float64Array].forEach(function (TypedArray) { + if (typeof TypedArray.prototype.sort === "undefined") { + Object.defineProperty(TypedArray.prototype, 'sort', { + value: function(compareFunction) { + compareFunction = compareFunction || function (a, b) { + if (a < b) return -1; + if (a > b) return 1; + if (a === b) { + if (a !== 0) return 0; + var ia = 1 / a; + return ia === 1 / b ? 0 : (ia < 0 ? -1 : 1); + } + return a !== a ? (b !== b ? 0 : 1) : -1 + } + return Array.prototype.sort.call(this, compareFunction || totalOrderComparator); + } + }); + } +}) +""") +internal inline fun Any.nativeSort(noinline comparison: (a: dynamic, b: dynamic) -> Int = js("undefined")): Unit { + asDynamic().sort(comparison) +} \ No newline at end of file diff --git a/libraries/stdlib/js/src/kotlin/js.math.kt b/libraries/stdlib/js/src/kotlin/js/js.math.kt similarity index 67% rename from libraries/stdlib/js/src/kotlin/js.math.kt rename to libraries/stdlib/js/src/kotlin/js/js.math.kt index 23c1712a5e7..de2d771e5e5 100644 --- a/libraries/stdlib/js/src/kotlin/js.math.kt +++ b/libraries/stdlib/js/src/kotlin/js/js.math.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * 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. */ @@ -33,24 +33,20 @@ internal external object JsMath { fun round(value: Number): Double fun floor(value: Number): Double fun ceil(value: Number): Double - - fun trunc(value: Number): Double - fun sign(value: Number): Double - - fun sinh(value: Double): Double - fun cosh(value: Double): Double - fun tanh(value: Double): Double - fun asinh(value: Double): Double - fun acosh(value: Double): Double - fun atanh(value: Double): Double - - fun hypot(x: Double, y: Double): Double - - fun expm1(value: Double): Double - fun log10(value: Double): Double - fun log2(value: Double): Double - fun log1p(value: Double): Double - - fun clz32(value: Int): Int } +internal const val defineTaylorNBound = """ + var epsilon = 2.220446049250313E-16; + var taylor_2_bound = Math.sqrt(epsilon); + var taylor_n_bound = Math.sqrt(taylor_2_bound); +""" + +internal const val defineUpperTaylor2Bound = """ + $defineTaylorNBound + var upper_taylor_2_bound = 1/taylor_2_bound; +""" + +internal const val defineUpperTaylorNBound = """ + $defineUpperTaylor2Bound + var upper_taylor_n_bound = 1/taylor_n_bound; +""" diff --git a/libraries/stdlib/js/src/kotlin/js/math.polyfills.kt b/libraries/stdlib/js/src/kotlin/js/math.polyfills.kt new file mode 100644 index 00000000000..8bdd0978923 --- /dev/null +++ b/libraries/stdlib/js/src/kotlin/js/math.polyfills.kt @@ -0,0 +1,308 @@ +/* + * 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. + */ + +@file:JsQualifier("Math") +package kotlin.js +// ES6 Math polyfills +// Inverse hyperbolic function implementations derived from boost special math functions, +// Copyright Eric Ford & Hubert Holin 2001. + +@PublishedApi +@JsName("sign") +@JsPolyfill(""" +if (typeof Math.sign === "undefined") { + Math.sign = function(x) { + x = +x; // convert to a number + if (x === 0 || isNaN(x)) { + return Number(x); + } + return x > 0 ? 1 : -1; + }; +} +""") +internal external fun nativeSign(value: Number): Double + +@PublishedApi +@JsName("trunc") +@JsPolyfill(""" +if (typeof Math.trunc === "undefined") { + Math.trunc = function(x) { + if (isNaN(x)) { + return NaN; + } + if (x > 0) { + return Math.floor(x); + } + return Math.ceil(x); + }; +} +""") +internal external fun nativeTrunc(value: Number): Double + +@PublishedApi +@JsName("sinh") +@JsPolyfill(""" +if (typeof Math.sinh === "undefined") { + $defineTaylorNBound + Math.sinh = function(x) { + if (Math.abs(x) < taylor_n_bound) { + var result = x; + if (Math.abs(x) > taylor_2_bound) { + result += (x * x * x) / 6; + } + return result; + } else { + var y = Math.exp(x); + var y1 = 1 / y; + if (!isFinite(y)) return Math.exp(x - Math.LN2); + if (!isFinite(y1)) return -Math.exp(-x - Math.LN2); + return (y - y1) / 2; + } + }; +} +""") +internal external fun nativeSinh(value: Double): Double + +@PublishedApi +@JsName("cosh") +@JsPolyfill(""" +if (typeof Math.cosh === "undefined") { + Math.cosh = function(x) { + var y = Math.exp(x); + var y1 = 1 / y; + if (!isFinite(y) || !isFinite(y1)) return Math.exp(Math.abs(x) - Math.LN2); + return (y + y1) / 2; + }; +} +""") +internal external fun nativeCosh(value: Double): Double + +@PublishedApi +@JsName("tanh") +@JsPolyfill(""" +if (typeof Math.tanh === "undefined") { + $defineTaylorNBound + Math.tanh = function(x){ + if (Math.abs(x) < taylor_n_bound) { + var result = x; + if (Math.abs(x) > taylor_2_bound) { + result -= (x * x * x) / 3; + } + return result; + } + else { + var a = Math.exp(+x), b = Math.exp(-x); + return a === Infinity ? 1 : b === Infinity ? -1 : (a - b) / (a + b); + } + }; +} +""") +internal external fun nativeTanh(value: Double): Double + +@PublishedApi +@JsName("asinh") +@JsPolyfill(""" +if (typeof Math.asinh === "undefined") { + $defineUpperTaylorNBound + var asinh = function(x) { + if (x >= +taylor_n_bound) + { + if (x > upper_taylor_n_bound) + { + if (x > upper_taylor_2_bound) + { + // approximation by laurent series in 1/x at 0+ order from -1 to 0 + return Math.log(x) + Math.LN2; + } + else + { + // approximation by laurent series in 1/x at 0+ order from -1 to 1 + return Math.log(x * 2 + (1 / (x * 2))); + } + } + else + { + return Math.log(x + Math.sqrt(x * x + 1)); + } + } + else if (x <= -taylor_n_bound) + { + return -asinh(-x); + } + else + { + // approximation by taylor series in x at 0 up to order 2 + var result = x; + if (Math.abs(x) >= taylor_2_bound) + { + var x3 = x * x * x; + // approximation by taylor series in x at 0 up to order 4 + result -= x3 / 6; + } + return result; + } + }; + Math.asinh = asinh; +} +""") +internal external fun nativeAsinh(value: Double): Double + +@PublishedApi +@JsName("acosh") +@JsPolyfill(""" +if (typeof Math.acosh === "undefined") { + $defineUpperTaylor2Bound + Math.acosh = function(x) { + if (x < 1) + { + return NaN; + } + else if (x - 1 >= taylor_n_bound) + { + if (x > upper_taylor_2_bound) + { + // approximation by laurent series in 1/x at 0+ order from -1 to 0 + return Math.log(x) + Math.LN2; + } + else + { + return Math.log(x + Math.sqrt(x * x - 1)); + } + } + else + { + var y = Math.sqrt(x - 1); + // approximation by taylor series in y at 0 up to order 2 + var result = y; + if (y >= taylor_2_bound) + { + var y3 = y * y * y; + // approximation by taylor series in y at 0 up to order 4 + result -= y3 / 12; + } + + return Math.sqrt(2) * result; + } + }; +} +""") +internal external fun nativeAcosh(value: Double): Double + +@PublishedApi +@JsName("atanh") +@JsPolyfill(""" +if (typeof Math.atanh === "undefined") { + $defineTaylorNBound + Math.atanh = function(x) { + if (Math.abs(x) < taylor_n_bound) { + var result = x; + if (Math.abs(x) > taylor_2_bound) { + result += (x * x * x) / 3; + } + return result; + } + return Math.log((1 + x) / (1 - x)) / 2; + }; +} +""") +internal external fun nativeAtanh(value: Double): Double + +@PublishedApi +@JsName("log1p") +@JsPolyfill(""" +if (typeof Math.log1p === "undefined") { + $defineTaylorNBound + Math.log1p = function(x) { + if (Math.abs(x) < taylor_n_bound) { + var x2 = x * x; + var x3 = x2 * x; + var x4 = x3 * x; + // approximation by taylor series in x at 0 up to order 4 + return (-x4 / 4 + x3 / 3 - x2 / 2 + x); + } + return Math.log(x + 1); + }; +} +""") +internal external fun nativeLog1p(value: Double): Double + +@PublishedApi +@JsName("expm1") +@JsPolyfill(""" +if (typeof Math.expm1 === "undefined") { + $defineTaylorNBound + Math.expm1 = function(x) { + if (Math.abs(x) < taylor_n_bound) { + var x2 = x * x; + var x3 = x2 * x; + var x4 = x3 * x; + // approximation by taylor series in x at 0 up to order 4 + return (x4 / 24 + x3 / 6 + x2 / 2 + x); + } + return Math.exp(x) - 1; + }; +} +""") +internal external fun nativeExpm1(value: Double): Double + +@PublishedApi +@JsName("hypot") +@JsPolyfill(""" +if (typeof Math.hypot === "undefined") { + Math.hypot = function() { + var y = 0; + var length = arguments.length; + + for (var i = 0; i < length; i++) { + if (arguments[i] === Infinity || arguments[i] === -Infinity) { + return Infinity; + } + y += arguments[i] * arguments[i]; + } + return Math.sqrt(y); + }; +} +""") +internal external fun nativeHypot(x: Double, y: Double): Double + + +@PublishedApi +@JsName("log10") +@JsPolyfill(""" +if (typeof Math.log10 === "undefined") { + Math.log10 = function(x) { + return Math.log(x) * Math.LOG10E; + }; +} +""") +internal external fun nativeLog10(value: Double): Double + +@PublishedApi +@JsName("log2") +@JsPolyfill(""" +if (typeof Math.log2 === "undefined") { + Math.log2 = function(x) { + return Math.log(x) * Math.LOG2E; + }; +} +""") +internal external fun nativeLog2(value: Double): Double + +@PublishedApi +@JsName("clz32") +@JsPolyfill(""" +if (typeof Math.clz32 === "undefined") { + Math.clz32 = (function(log, LN2) { + return function(x) { + var asUint = x >>> 0; + if (asUint === 0) { + return 32; + } + return 31 - (log(asUint) / LN2 | 0) | 0; // the "| 0" acts like math.floor + }; + })(Math.log, Math.LN2); +} +""") +internal external fun nativeClz32(value: Int): Int \ No newline at end of file diff --git a/libraries/stdlib/js/src/kotlin/math.kt b/libraries/stdlib/js/src/kotlin/math.kt index 9c2de1ee8b3..9421a51ab1b 100644 --- a/libraries/stdlib/js/src/kotlin/math.kt +++ b/libraries/stdlib/js/src/kotlin/math.kt @@ -101,7 +101,7 @@ public actual inline fun atan2(y: Double, x: Double): Double = nativeMath.atan2( */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun sinh(x: Double): Double = nativeMath.sinh(x) +public actual inline fun sinh(x: Double): Double = nativeSinh(x) /** * Computes the hyperbolic cosine of the value [x]. @@ -112,7 +112,7 @@ public actual inline fun sinh(x: Double): Double = nativeMath.sinh(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun cosh(x: Double): Double = nativeMath.cosh(x) +public actual inline fun cosh(x: Double): Double = nativeCosh(x) /** * Computes the hyperbolic tangent of the value [x]. @@ -124,7 +124,7 @@ public actual inline fun cosh(x: Double): Double = nativeMath.cosh(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun tanh(x: Double): Double = nativeMath.tanh(x) +public actual inline fun tanh(x: Double): Double = nativeTanh(x) /** * Computes the inverse hyperbolic sine of the value [x]. @@ -138,7 +138,7 @@ public actual inline fun tanh(x: Double): Double = nativeMath.tanh(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun asinh(x: Double): Double = nativeMath.asinh(x) +public actual inline fun asinh(x: Double): Double = nativeAsinh(x) /** * Computes the inverse hyperbolic cosine of the value [x]. @@ -152,7 +152,7 @@ public actual inline fun asinh(x: Double): Double = nativeMath.asinh(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun acosh(x: Double): Double = nativeMath.acosh(x) +public actual inline fun acosh(x: Double): Double = nativeAcosh(x) /** * Computes the inverse hyperbolic tangent of the value [x]. @@ -167,7 +167,7 @@ public actual inline fun acosh(x: Double): Double = nativeMath.acosh(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun atanh(x: Double): Double = nativeMath.atanh(x) +public actual inline fun atanh(x: Double): Double = nativeAtanh(x) /** * Computes `sqrt(x^2 + y^2)` without intermediate overflow or underflow. @@ -178,7 +178,7 @@ public actual inline fun atanh(x: Double): Double = nativeMath.atanh(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun hypot(x: Double, y: Double): Double = nativeMath.hypot(x, y) +public actual inline fun hypot(x: Double, y: Double): Double = nativeHypot(x, y) /** * Computes the positive square root of the value [x]. @@ -216,7 +216,7 @@ public actual inline fun exp(x: Double): Double = nativeMath.exp(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun expm1(x: Double): Double = nativeMath.expm1(x) +public actual inline fun expm1(x: Double): Double = nativeExpm1(x) /** * Computes the logarithm of the value [x] to the given [base]. @@ -256,7 +256,7 @@ public actual inline fun ln(x: Double): Double = nativeMath.log(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun log10(x: Double): Double = nativeMath.log10(x) +public actual inline fun log10(x: Double): Double = nativeLog10(x) /** * Computes the binary logarithm (base 2) of the value [x]. @@ -265,7 +265,7 @@ public actual inline fun log10(x: Double): Double = nativeMath.log10(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun log2(x: Double): Double = nativeMath.log2(x) +public actual inline fun log2(x: Double): Double = nativeLog2(x) /** * Computes `ln(x + 1)`. @@ -283,7 +283,7 @@ public actual inline fun log2(x: Double): Double = nativeMath.log2(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun ln1p(x: Double): Double = nativeMath.log1p(x) +public actual inline fun ln1p(x: Double): Double = nativeLog1p(x) /** * Rounds the given value [x] to an integer towards positive infinity. @@ -319,7 +319,7 @@ public actual inline fun floor(x: Double): Double = nativeMath.floor(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun truncate(x: Double): Double = nativeMath.trunc(x) +public actual inline fun truncate(x: Double): Double = nativeTrunc(x) /** * Rounds the given value [x] towards the closest integer with ties rounded towards even integer. @@ -359,7 +359,7 @@ public actual inline fun abs(x: Double): Double = nativeMath.abs(x) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun sign(x: Double): Double = nativeMath.sign(x) +public actual inline fun sign(x: Double): Double = nativeSign(x) /** @@ -429,7 +429,7 @@ public actual inline val Double.absoluteValue: Double get() = nativeMath.abs(thi */ @SinceKotlin("1.2") @InlineOnly -public actual inline val Double.sign: Double get() = nativeMath.sign(this) +public actual inline val Double.sign: Double get() = nativeSign(this) /** * Returns this value with the sign bit same as of the [sign] value. @@ -626,7 +626,7 @@ public actual inline fun atan2(y: Float, x: Float): Float = nativeMath.atan2(y.t */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun sinh(x: Float): Float = nativeMath.sinh(x.toDouble()).toFloat() +public actual inline fun sinh(x: Float): Float = nativeSinh(x.toDouble()).toFloat() /** * Computes the hyperbolic cosine of the value [x]. @@ -637,7 +637,7 @@ public actual inline fun sinh(x: Float): Float = nativeMath.sinh(x.toDouble()).t */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun cosh(x: Float): Float = nativeMath.cosh(x.toDouble()).toFloat() +public actual inline fun cosh(x: Float): Float = nativeCosh(x.toDouble()).toFloat() /** * Computes the hyperbolic tangent of the value [x]. @@ -649,7 +649,7 @@ public actual inline fun cosh(x: Float): Float = nativeMath.cosh(x.toDouble()).t */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun tanh(x: Float): Float = nativeMath.tanh(x.toDouble()).toFloat() +public actual inline fun tanh(x: Float): Float = nativeTanh(x.toDouble()).toFloat() /** * Computes the inverse hyperbolic sine of the value [x]. @@ -663,7 +663,7 @@ public actual inline fun tanh(x: Float): Float = nativeMath.tanh(x.toDouble()).t */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun asinh(x: Float): Float = nativeMath.asinh(x.toDouble()).toFloat() +public actual inline fun asinh(x: Float): Float = nativeAsinh(x.toDouble()).toFloat() /** * Computes the inverse hyperbolic cosine of the value [x]. @@ -677,7 +677,7 @@ public actual inline fun asinh(x: Float): Float = nativeMath.asinh(x.toDouble()) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun acosh(x: Float): Float = nativeMath.acosh(x.toDouble()).toFloat() +public actual inline fun acosh(x: Float): Float = nativeAcosh(x.toDouble()).toFloat() /** * Computes the inverse hyperbolic tangent of the value [x]. @@ -692,7 +692,7 @@ public actual inline fun acosh(x: Float): Float = nativeMath.acosh(x.toDouble()) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun atanh(x: Float): Float = nativeMath.atanh(x.toDouble()).toFloat() +public actual inline fun atanh(x: Float): Float = nativeAtanh(x.toDouble()).toFloat() /** * Computes `sqrt(x^2 + y^2)` without intermediate overflow or underflow. @@ -703,7 +703,7 @@ public actual inline fun atanh(x: Float): Float = nativeMath.atanh(x.toDouble()) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun hypot(x: Float, y: Float): Float = nativeMath.hypot(x.toDouble(), y.toDouble()).toFloat() +public actual inline fun hypot(x: Float, y: Float): Float = nativeHypot(x.toDouble(), y.toDouble()).toFloat() /** * Computes the positive square root of the value [x]. @@ -741,7 +741,7 @@ public actual inline fun exp(x: Float): Float = nativeMath.exp(x.toDouble()).toF */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun expm1(x: Float): Float = nativeMath.expm1(x.toDouble()).toFloat() +public actual inline fun expm1(x: Float): Float = nativeExpm1(x.toDouble()).toFloat() /** * Computes the logarithm of the value [x] to the given [base]. @@ -779,7 +779,7 @@ public actual inline fun ln(x: Float): Float = nativeMath.log(x.toDouble()).toFl */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun log10(x: Float): Float = nativeMath.log10(x.toDouble()).toFloat() +public actual inline fun log10(x: Float): Float = nativeLog10(x.toDouble()).toFloat() /** * Computes the binary logarithm (base 2) of the value [x]. @@ -788,7 +788,7 @@ public actual inline fun log10(x: Float): Float = nativeMath.log10(x.toDouble()) */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun log2(x: Float): Float = nativeMath.log2(x.toDouble()).toFloat() +public actual inline fun log2(x: Float): Float = nativeLog2(x.toDouble()).toFloat() /** * Computes `ln(a + 1)`. @@ -806,7 +806,7 @@ public actual inline fun log2(x: Float): Float = nativeMath.log2(x.toDouble()).t */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun ln1p(x: Float): Float = nativeMath.log1p(x.toDouble()).toFloat() +public actual inline fun ln1p(x: Float): Float = nativeLog1p(x.toDouble()).toFloat() /** * Rounds the given value [x] to an integer towards positive infinity. @@ -878,7 +878,7 @@ public actual inline fun abs(x: Float): Float = nativeMath.abs(x.toDouble()).toF */ @SinceKotlin("1.2") @InlineOnly -public actual inline fun sign(x: Float): Float = nativeMath.sign(x.toDouble()).toFloat() +public actual inline fun sign(x: Float): Float = nativeSign(x.toDouble()).toFloat() @@ -950,7 +950,7 @@ public actual inline val Float.absoluteValue: Float get() = nativeMath.abs(this. */ @SinceKotlin("1.2") @InlineOnly -public actual inline val Float.sign: Float get() = nativeMath.sign(this.toDouble()).toFloat() +public actual inline val Float.sign: Float get() = nativeSign(this.toDouble()).toFloat() /** * Returns this value with the sign bit same as of the [sign] value. diff --git a/libraries/stdlib/js/src/kotlin/numbers.kt b/libraries/stdlib/js/src/kotlin/numbers.kt index 5afb0be773f..0e0c2397453 100644 --- a/libraries/stdlib/js/src/kotlin/numbers.kt +++ b/libraries/stdlib/js/src/kotlin/numbers.kt @@ -60,7 +60,7 @@ public actual fun Int.countOneBits(): Int { @SinceKotlin("1.4") @WasExperimental(ExperimentalStdlibApi::class) @kotlin.internal.InlineOnly -public actual inline fun Int.countLeadingZeroBits(): Int = JsMath.clz32(this) +public actual inline fun Int.countLeadingZeroBits(): Int = nativeClz32(this) /** * Counts the number of consecutive least significant bits that are zero in the binary representation of this [Int] number. diff --git a/libraries/stdlib/js/src/kotlin/text/string.kt b/libraries/stdlib/js/src/kotlin/text/string.kt index aa8c7c0d06b..2eee5c537fb 100644 --- a/libraries/stdlib/js/src/kotlin/text/string.kt +++ b/libraries/stdlib/js/src/kotlin/text/string.kt @@ -217,9 +217,34 @@ internal actual inline fun String.nativeIndexOf(str: String, fromIndex: Int): In internal actual inline fun String.nativeLastIndexOf(str: String, fromIndex: Int): Int = asDynamic().lastIndexOf(str, fromIndex) @kotlin.internal.InlineOnly +@kotlin.js.JsPolyfill(""" +if (typeof String.prototype.startsWith === "undefined") { + Object.defineProperty(String.prototype, "startsWith", { + value: function (searchString, position) { + position = position || 0; + return this.lastIndexOf(searchString, position) === position; + } + }); +} +""") internal inline fun String.nativeStartsWith(s: String, position: Int): Boolean = asDynamic().startsWith(s, position) @kotlin.internal.InlineOnly +@kotlin.js.JsPolyfill(""" +if (typeof String.prototype.endsWith === "undefined") { + Object.defineProperty(String.prototype, "endsWith", { + value: function (searchString, position) { + var subjectString = this.toString(); + if (position === undefined || position > subjectString.length) { + position = subjectString.length; + } + position -= searchString.length; + var lastIndex = subjectString.indexOf(searchString, position); + return lastIndex !== -1 && lastIndex === position; + } + }); +} +""") internal inline fun String.nativeEndsWith(s: String): Boolean = asDynamic().endsWith(s) @kotlin.internal.InlineOnly diff --git a/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt b/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt index c2530b21035..04c797f6db5 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/templates/Arrays.kt @@ -1223,9 +1223,9 @@ object ArrayOps : TemplateGroupBase() { if (primitive == PrimitiveType.Char) { // Requires comparator because default comparator of 'Array.prototype.sort' compares // string representation of values - body { "this.asDynamic().sort(::primitiveCompareTo)" } + body { "nativeSort(::primitiveCompareTo)" } } else { - body { "this.asDynamic().sort()" } + body { "nativeSort()" } } } } else { @@ -1292,7 +1292,7 @@ object ArrayOps : TemplateGroupBase() { deprecate(Deprecation("Use other sorting functions from the Standard Library", warningSince = "1.6")) inlineOnly() signature("sort(noinline comparison: (a: T, b: T) -> Int)") - body { "asDynamic().sort(comparison)" } + body { "nativeSort(comparison)" } } specialFor(ArraysOfObjects) { deprecate( @@ -1641,7 +1641,7 @@ object ArrayOps : TemplateGroupBase() { body { """ AbstractList.checkRangeIndexes(fromIndex, toIndex, size) - this.asDynamic().fill(element, fromIndex, toIndex); + nativeFill(element, fromIndex, toIndex); """ } } diff --git a/license/README.md b/license/README.md index f5699787c3b..5f0aa9f2a09 100644 --- a/license/README.md +++ b/license/README.md @@ -93,6 +93,10 @@ the Kotlin IntelliJ IDEA plugin: - License: Boost Software License 1.0 ([license/third_party/boost_LICENSE.txt][boost]) - Origin: Derived from boost special math functions, Copyright Eric Ford & Hubert Holin 2001. + - Path: libraries/stdlib/js/src/kotlin/js/math.polyfills.kt + - License: Boost Software License 1.0 ([license/third_party/boost_LICENSE.txt][boost]) + - Origin: Derived from boost special math functions, Copyright Eric Ford & Hubert Holin 2001. + - Path: libraries/stdlib/wasm/internal/kotlin/wasm/internal/Number2String.kt - License: Apache 2 ([third_party/assemblyscript_license.txt][assemblyscript]) - Origin: Derived from assemblyscript standard library