From a939f9ccd090e8059411ac61e871608699588391 Mon Sep 17 00:00:00 2001 From: Sergej Jaskiewicz Date: Thu, 13 Oct 2022 19:15:49 +0200 Subject: [PATCH] [JS IR] Improve debug info precision for blocks Namely: - Generate debug info for closing braces, which allows the breakpoints set on closing braces to be hit - Generate debug info for 'if' and 'try/catch' statements. KT-46276 --- .../lower/InteropCallableReferenceLowering.kt | 18 +++++- .../IrElementToJsStatementTransformer.kt | 10 ++-- .../js/transformers/irToJs/jsAstUtils.kt | 59 +++++++++++++------ .../backend/js/transformers/irToJs/jsCode.kt | 4 +- .../backend/js/utils/JsGenerationContext.kt | 25 +++++--- .../debug/stepping/IfTrueThenFalse.kt | 1 + .../debug/stepping/anonymousFunction.kt | 3 +- .../debug/stepping/anonymousFunctionDirect.kt | 1 + .../debug/stepping/beforeGotoToWhileStart.kt | 2 + .../debug/stepping/callWithCallInArguments.kt | 5 ++ .../debug/stepping/callWithReceiver.kt | 4 +- .../debug/stepping/callableReference.kt | 6 +- compiler/testData/debug/stepping/chainCall.kt | 4 +- compiler/testData/debug/stepping/class.kt | 5 +- .../testData/debug/stepping/classObject.kt | 4 +- .../debug/stepping/compileTimeConstant.kt | 1 + .../testData/debug/stepping/conjunction.kt | 1 + .../debug/stepping/constantConditions.kt | 1 + .../debug/stepping/constructorCall.kt | 7 ++- .../testData/debug/stepping/constructors.kt | 16 ++++- compiler/testData/debug/stepping/dataClass.kt | 10 +++- .../debug/stepping/defaultParameter.kt | 6 +- compiler/testData/debug/stepping/enum.kt | 8 ++- compiler/testData/debug/stepping/for.kt | 1 + .../debug/stepping/functionCallWithDefault.kt | 3 +- .../stepping/functionCallWithLambdaParam.kt | 7 ++- .../debug/stepping/functionInAnotherFile.kt | 1 + compiler/testData/debug/stepping/if2.kt | 3 + compiler/testData/debug/stepping/ifThen.kt | 2 + .../testData/debug/stepping/ifThenElse.kt | 3 + .../debug/stepping/ifThenElseFalse.kt | 3 + .../debug/stepping/ifWithInlineInCondition.kt | 5 ++ .../testData/debug/stepping/iincStepping.kt | 1 + .../testData/debug/stepping/initBlocks.kt | 7 ++- .../debug/stepping/initBlocksCompanion.kt | 4 +- .../debug/stepping/inlineCallableReference.kt | 1 + .../stepping/inlineNamedCallableReference.kt | 2 + compiler/testData/debug/stepping/jsCode.kt | 2 + compiler/testData/debug/stepping/kt15259.kt | 2 + compiler/testData/debug/stepping/kt29179.kt | 5 +- compiler/testData/debug/stepping/kt42208.kt | 1 + compiler/testData/debug/stepping/kt42208b.kt | 1 + compiler/testData/debug/stepping/kt42208c.kt | 5 +- .../debug/stepping/lineNumberAfterInline.kt | 4 ++ .../testData/debug/stepping/multiModule.kt | 1 + .../debug/stepping/multilineExpression.kt | 1 + .../debug/stepping/multilineFunctionCall.kt | 2 + .../debug/stepping/multilineInfixCall.kt | 2 + .../debug/stepping/namedCallableReference.kt | 6 +- compiler/testData/debug/stepping/nullcheck.kt | 1 + .../debug/stepping/propertyAccessor.kt | 4 +- compiler/testData/debug/stepping/psvm.kt | 2 + compiler/testData/debug/stepping/recursion.kt | 1 + .../debug/stepping/smapInlineAsArgument.kt | 3 + .../stepping/smapInlineAsInfixArgument.kt | 1 + .../stepping/smapInlineAsInlineArgument.kt | 1 + .../stepping/smapInlineInIntrinsicArgument.kt | 1 + .../testData/debug/stepping/stringSwitches.kt | 5 ++ .../debug/stepping/stringSwitchesSmall.kt | 4 ++ .../testData/debug/stepping/throwException.kt | 3 +- compiler/testData/debug/stepping/topLevel.kt | 1 + compiler/testData/debug/stepping/trait.kt | 3 + compiler/testData/debug/stepping/tryCatch.kt | 4 ++ .../testData/debug/stepping/tryFinally.kt | 6 +- .../stepping/variablesWithoutInitializer.kt | 1 + compiler/testData/debug/stepping/when.kt | 8 +++ .../debug/stepping/whenComplicatedSubject.kt | 4 ++ .../testData/debug/stepping/whenConstant.kt | 1 + .../testData/debug/stepping/whenIsChecks.kt | 4 ++ .../testData/debug/stepping/whenMultiLine.kt | 1 + .../debug/stepping/whenMultiLineSubject.kt | 1 + .../debug/stepping/whenNullalbeSubject.kt | 1 + .../testData/debug/stepping/whenSubject.kt | 8 +++ .../testData/debug/stepping/whenSubject2.kt | 8 +++ .../stepping/whenWithInlineInCondition.kt | 3 + compiler/testData/debug/stepping/while.kt | 1 + .../backend/JsToStringGenerationVisitor.java | 36 ++++++----- .../kotlin/js/backend/ast/JsBlock.java | 17 +++++- .../jetbrains/kotlin/js/backend/ast/JsIf.java | 3 + .../lineNumbers/andAndWithSideEffect.kt | 4 +- .../testData/lineNumbers/backingField.kt | 4 +- .../testData/lineNumbers/catch.kt | 4 +- .../testData/lineNumbers/chainedCall.kt | 4 +- .../lineNumbers/classCapturingLocals.kt | 2 +- .../testData/lineNumbers/closure.kt | 4 +- .../complexExpressionAsDefaultArgument.kt | 4 +- .../lineNumbers/conditionalDecomposed.kt | 4 +- .../testData/lineNumbers/coroutine.kt | 2 +- .../lineNumbers/coroutineNullAssertion.kt | 2 +- .../testData/lineNumbers/dataClass.kt | 2 +- .../testData/lineNumbers/delegateMemberVal.kt | 2 +- .../testData/lineNumbers/delegatedProperty.kt | 4 +- .../testData/lineNumbers/delegation.kt | 2 +- .../testData/lineNumbers/destructuring.kt | 2 +- .../lineNumbers/destructuringInline.kt | 2 +- .../doWhileWithComplexCondition.kt | 4 +- .../testData/lineNumbers/elvis.kt | 2 +- .../lineNumbers/enumCompanionObject.kt | 4 +- .../testData/lineNumbers/enumObject.kt | 2 +- .../lineNumbers/expressionAsFunctionBody.kt | 4 +- js/js.translator/testData/lineNumbers/for.kt | 2 +- .../testData/lineNumbers/increment.kt | 4 +- .../testData/lineNumbers/inlineArguments.kt | 2 +- .../lineNumbers/inlineLocalVarsRef.kt | 4 +- .../lineNumbers/inlineMultiModule/simple.kt | 6 +- .../testData/lineNumbers/inlineReturn.kt | 4 +- .../testData/lineNumbers/inlining.kt | 4 +- .../lineNumbers/inliningWithLambda.kt | 4 +- .../testData/lineNumbers/innerClass.kt | 4 +- .../testData/lineNumbers/isOperator.kt | 4 +- .../testData/lineNumbers/jsCode.kt | 4 +- .../testData/lineNumbers/lambdaWithClosure.kt | 2 +- .../lastExpressionInInlineLambda.kt | 4 +- .../testData/lineNumbers/literals.kt | 4 +- .../testData/lineNumbers/longLiteral.kt | 4 +- .../lineNumbers/memberFunWithDefaultParam.kt | 4 +- .../lineNumbers/multipleReferences.kt | 4 +- .../lineNumbers/objectInstanceFunction.kt | 4 +- .../lineNumbers/propertyWithoutInitializer.kt | 4 +- .../testData/lineNumbers/simple.kt | 4 +- .../testData/lineNumbers/stringLiteral.kt | 4 +- .../syntheticCodeInConstructors.kt | 4 +- .../lineNumbers/syntheticCodeInEnums.kt | 2 +- .../testData/lineNumbers/valParameter.kt | 4 +- .../whenEntryWithMultipleConditions.kt | 2 +- ...EntryWithMultipleConditionsNonOptimized.kt | 2 +- .../testData/lineNumbers/whenIn.kt | 4 +- .../testData/lineNumbers/whenIs.kt | 4 +- .../lineNumbers/whileWithComplexCondition.kt | 4 +- 129 files changed, 423 insertions(+), 160 deletions(-) diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/InteropCallableReferenceLowering.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/InteropCallableReferenceLowering.kt index 774c3b3217f..ae3106d3b92 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/InteropCallableReferenceLowering.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/InteropCallableReferenceLowering.kt @@ -353,11 +353,13 @@ class InteropCallableReferenceLowering(val context: JsIrBackendContext) : BodyLo lambdaContextMapping: Map, outerReceiverMapping: Map = emptyMap() ): IrBlockBody { - val body = invokeFun.body + val oldBody = invokeFun.body as? IrBlockBody ?: compilationException( "invoke() method has to have a body", invokeFun ) + // Don't use offsets from oldBody, use offsets from invokeFun instead. This is more precise. + val body = context.irFactory.createBlockBody(invokeFun.startOffset, invokeFun.endOffset, oldBody.statements) fun IrExpression.getValue(d: IrValueSymbol): IrExpression = IrGetValueImpl(startOffset, endOffset, d) fun IrExpression.getCastedValue(d: IrValueSymbol, toType: IrType): IrExpression = @@ -406,10 +408,20 @@ class InteropCallableReferenceLowering(val context: JsIrBackendContext) : BodyLo if (invokeFun.returnType.isUnit()) { val unitValue = JsIrBuilder.buildGetObjectValue(context.irBuiltIns.unitType, context.irBuiltIns.unitClass) - (body as IrBlockBody).statements.add(IrReturnImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, context.irBuiltIns.nothingType, lambdaDeclaration.symbol, unitValue)) + // Set both offsets of the IrReturn to body.endOffset - 1 so that a breakpoint set at the closing brace of a lambda expression + // could be hit. + body.statements.add( + IrReturnImpl( + body.endOffset - 1, + body.endOffset - 1, + context.irBuiltIns.nothingType, + lambdaDeclaration.symbol, + unitValue + ) + ) } - return body as IrBlockBody + return body } private fun buildLambdaBody(instance: IrVariable, lambdaDeclaration: IrSimpleFunction, invokeFun: IrSimpleFunction): IrBlockBody { diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt index 60f0cf6ddd8..21715e2bf8c 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/IrElementToJsStatementTransformer.kt @@ -32,7 +32,7 @@ class IrElementToJsStatementTransformer : BaseIrElementToJsNodeTransformer.wrapInCommentsInlineFunctionCall(expression: IrReturnableBlock): List { @@ -65,7 +65,7 @@ class IrElementToJsStatementTransformer : BaseIrElementToJsNodeTransformer IrWhen.toJsNode( tr: BaseIrElementToJsNodeTransformer, - data: JsGenerationContext, + context: JsGenerationContext, node: (JsExpression, T, T?) -> T, implicitElse: T? = null ): T? = branches.foldRight(implicitElse) { br, n -> - val body = br.result.accept(tr, data) + val body = br.result.accept(tr, context) if (isElseBranch(br)) body else { - val condition = br.condition.accept(IrElementToJsExpressionTransformer(), data) - node(condition, body, n) + val condition = br.condition.accept(IrElementToJsExpressionTransformer(), context) + node(condition, body, n).withSource(br, context) } } @@ -521,25 +521,46 @@ object JsAstUtils { } } -internal fun T.withSource(node: IrElement, context: JsGenerationContext, useNameOf: IrDeclarationWithName? = null): T { - addSourceInfoIfNeed(node, context, useNameOf) +internal fun T.withSource( + node: IrElement, + context: JsGenerationContext, + useNameOf: IrDeclarationWithName? = null, + container: IrDeclaration? = null +): T { + addSourceInfoIfNeed(node, context, useNameOf, container) return this } @Suppress("NOTHING_TO_INLINE") -private inline fun T.addSourceInfoIfNeed(node: IrElement, context: JsGenerationContext, useNameOf: IrDeclarationWithName?) { - +private inline fun T.addSourceInfoIfNeed( + node: IrElement, + context: JsGenerationContext, + useNameOf: IrDeclarationWithName?, + container: IrDeclaration? +) { val sourceMapsInfo = context.staticContext.backendContext.sourceMapsInfo ?: return - val originalName = useNameOf?.originalNameForUseInSourceMap(sourceMapsInfo.namesPolicy) - - val location = context.getLocationForIrElement(node, originalName) ?: return - + val location = context.getStartLocationForIrElement(node, originalName) ?: return val isNodeFromCurrentModule = context.currentFile.module.descriptor == context.staticContext.backendContext.module // TODO maybe it's better to fix in JsExpressionStatement val locationTarget = if (this is JsExpressionStatement) this.expression else this + if (locationTarget is JsBlock && (node is IrBlockBody || node is IrBlock)) { + locationTarget.closingBraceSource = if (container is IrConstructor) { + // This is a hack. Without this special case, the closing brace in the generated code for constructors would always be mapped + // to the closing brace of the Kotlin class declaration. + context.getStartLocationForIrElement(node) + } else { + context.getEndLocationForIrElement(node)?.run { + // Assuming that endOffset for IrBlock and IrBlockBody points to the character after the closing brace. + // TODO: This doesn't produce good results if the node originates from an expression body + // (meaning, in the source code; not to be confused with IrExpressionBody) + if (startChar > 0) copy(startChar = startChar - 1) else null + } + } + } + locationTarget.source = when (sourceMapsInfo.sourceMapContentEmbedding) { SourceMapSourceEmbedding.NEVER -> location SourceMapSourceEmbedding.INLINING -> if (isNodeFromCurrentModule) location else location.withEmbeddedSource(context) @@ -568,16 +589,20 @@ private fun JsLocation.withEmbeddedSource( } } -fun IrElement.getSourceInfo(container: IrDeclaration): JsLocation? { +fun IrElement.getStartSourceLocation(container: IrDeclaration): JsLocation? { val fileEntry = container.fileOrNull?.fileEntry ?: return null - return getSourceInfo(fileEntry) + return getStartSourceLocation(fileEntry) } -fun IrElement.getSourceInfo(fileEntry: IrFileEntry): JsLocation? { +fun IrElement.getStartSourceLocation(fileEntry: IrFileEntry) = + getSourceLocation(fileEntry) { startOffset } + +inline fun IrElement.getSourceLocation(fileEntry: IrFileEntry, offsetSelector: IrElement.() -> Int): JsLocation? { if (startOffset == UNDEFINED_OFFSET || endOffset == UNDEFINED_OFFSET) return null val path = fileEntry.name - val startLine = fileEntry.getLineNumber(startOffset) - val startColumn = fileEntry.getColumnNumber(startOffset) + val offset = offsetSelector() + val startLine = fileEntry.getLineNumber(offset) + val startColumn = fileEntry.getColumnNumber(offset) return JsLocation(path, startLine, startColumn) } diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsCode.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsCode.kt index 1d75dd99c43..a8c6af82cf8 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsCode.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/transformers/irToJs/jsCode.kt @@ -28,14 +28,14 @@ fun translateJsCodeIntoStatementList(code: IrExpression, context: JsIrBackendCon translateJsCodeIntoStatementList( code, context, - code.getSourceInfo(container) ?: container.fileOrNull?.fileEntry?.let { JsLocation(it.name, 0, 0) } + code.getStartSourceLocation(container) ?: container.fileOrNull?.fileEntry?.let { JsLocation(it.name, 0, 0) } ) /** * Returns null if constant expression could not be parsed. */ fun translateJsCodeIntoStatementList(code: IrExpression, context: JsIrBackendContext?, fileEntry: IrFileEntry) = - translateJsCodeIntoStatementList(code, context, code.getSourceInfo(fileEntry) ?: JsLocation(fileEntry.name, 0, 0)) + translateJsCodeIntoStatementList(code, context, code.getStartSourceLocation(fileEntry) ?: JsLocation(fileEntry.name, 0, 0)) private fun translateJsCodeIntoStatementList( code: IrExpression, diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/JsGenerationContext.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/JsGenerationContext.kt index c8a85aea25d..0dfa3ead5dc 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/JsGenerationContext.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/utils/JsGenerationContext.kt @@ -6,7 +6,8 @@ package org.jetbrains.kotlin.ir.backend.js.utils import org.jetbrains.kotlin.ir.IrElement -import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.getSourceInfo +import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.getSourceLocation +import org.jetbrains.kotlin.ir.backend.js.transformers.irToJs.getStartSourceLocation import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.expressions.IrLoop import org.jetbrains.kotlin.ir.expressions.IrReturnableBlock @@ -33,7 +34,8 @@ class JsGenerationContext( private val nameCache: MutableMap = mutableMapOf(), private val useBareParameterNames: Boolean = false, ) : IrNamer by staticContext { - private val locationCache = mutableMapOf() + private val startLocationCache = mutableMapOf() + private val endLocationCache = mutableMapOf() fun newFile(file: IrFile, func: IrFunction? = null, localNames: LocalNameGenerator? = null): JsGenerationContext { return JsGenerationContext( @@ -87,9 +89,18 @@ class JsGenerationContext( fun checkIfHasAssociatedJsCode(symbol: IrFunctionSymbol): Boolean = staticContext.backendContext.getJsCodeForFunction(symbol) != null - fun getLocationForIrElement(irElement: IrElement, originalName: String? = null): JsLocation? { - return locationCache.getOrPut(irElement.startOffset) { - irElement.getSourceInfo(currentFile.fileEntry) ?: return null - }.copy(name = originalName) - } + fun getStartLocationForIrElement(irElement: IrElement, originalName: String? = null) = + getLocationForIrElement(irElement, originalName, startLocationCache) { startOffset } + + fun getEndLocationForIrElement(irElement: IrElement, originalName: String? = null) = + getLocationForIrElement(irElement, originalName, endLocationCache) { endOffset } + + private inline fun getLocationForIrElement( + irElement: IrElement, + originalName: String?, + cache: MutableMap, + offsetSelector: IrElement.() -> Int, + ): JsLocation? = cache.getOrPut(irElement.offsetSelector()) { + irElement.getSourceLocation(currentFile.fileEntry, offsetSelector) ?: return null + }.copy(name = originalName) } diff --git a/compiler/testData/debug/stepping/IfTrueThenFalse.kt b/compiler/testData/debug/stepping/IfTrueThenFalse.kt index 1973b60ba6c..f9338902b40 100644 --- a/compiler/testData/debug/stepping/IfTrueThenFalse.kt +++ b/compiler/testData/debug/stepping/IfTrueThenFalse.kt @@ -18,3 +18,4 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:5 box // test.kt:2 cond +// test.kt:9 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/anonymousFunction.kt b/compiler/testData/debug/stepping/anonymousFunction.kt index ee25c7e5faa..71ce20c24d3 100644 --- a/compiler/testData/debug/stepping/anonymousFunction.kt +++ b/compiler/testData/debug/stepping/anonymousFunction.kt @@ -19,4 +19,5 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:6 box // test.kt:3 eval -// test.kt:7 box$lambda \ No newline at end of file +// test.kt:7 box$lambda +// test.kt:9 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/anonymousFunctionDirect.kt b/compiler/testData/debug/stepping/anonymousFunctionDirect.kt index b102420fc21..582ec9cc66a 100644 --- a/compiler/testData/debug/stepping/anonymousFunctionDirect.kt +++ b/compiler/testData/debug/stepping/anonymousFunctionDirect.kt @@ -18,3 +18,4 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:4 box // test.kt:5 box$lambda +// test.kt:7 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/beforeGotoToWhileStart.kt b/compiler/testData/debug/stepping/beforeGotoToWhileStart.kt index 224ac278406..13649742295 100644 --- a/compiler/testData/debug/stepping/beforeGotoToWhileStart.kt +++ b/compiler/testData/debug/stepping/beforeGotoToWhileStart.kt @@ -44,3 +44,5 @@ fun box() { // test.kt:6 alternate // test.kt:7 alternate // test.kt:13 foo +// test.kt:16 foo +// test.kt:20 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/callWithCallInArguments.kt b/compiler/testData/debug/stepping/callWithCallInArguments.kt index 63a6a92c3f0..77106d9268d 100644 --- a/compiler/testData/debug/stepping/callWithCallInArguments.kt +++ b/compiler/testData/debug/stepping/callWithCallInArguments.kt @@ -34,9 +34,14 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:8 box +// test.kt:3 // test.kt:9 box // test.kt:5 bar +// test.kt:3 // test.kt:10 box // test.kt:5 bar +// test.kt:3 // test.kt:9 box // test.kt:5 bar +// test.kt:3 +// test.kt:14 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/callWithReceiver.kt b/compiler/testData/debug/stepping/callWithReceiver.kt index 53cfc302796..b8ca5d5cf01 100644 --- a/compiler/testData/debug/stepping/callWithReceiver.kt +++ b/compiler/testData/debug/stepping/callWithReceiver.kt @@ -29,6 +29,8 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:9 box +// test.kt:3 // test.kt:11 box // test.kt:4 foo -// test.kt:5 box \ No newline at end of file +// test.kt:5 box +// test.kt:15 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/callableReference.kt b/compiler/testData/debug/stepping/callableReference.kt index f996b9dc705..b66fa45cc50 100644 --- a/compiler/testData/debug/stepping/callableReference.kt +++ b/compiler/testData/debug/stepping/callableReference.kt @@ -23,7 +23,9 @@ fun f(block: () -> Unit) { // EXPECTATIONS JS_IR // test.kt:3 box // test.kt:4 box -// test.kt:4 box$lambda // test.kt:4 box // test.kt:10 f -// test.kt:5 box$lambda$lambda \ No newline at end of file +// test.kt:5 box$lambda$lambda +// test.kt:6 box$lambda$lambda +// test.kt:11 f +// test.kt:7 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/chainCall.kt b/compiler/testData/debug/stepping/chainCall.kt index 86d1f046936..849baa49d31 100644 --- a/compiler/testData/debug/stepping/chainCall.kt +++ b/compiler/testData/debug/stepping/chainCall.kt @@ -31,10 +31,12 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:9 box +// test.kt:3 // test.kt:10 box // test.kt:4 foo // test.kt:11 box // test.kt:4 foo // test.kt:5 box // test.kt:13 box -// test.kt:5 box \ No newline at end of file +// test.kt:5 box +// test.kt:15 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/class.kt b/compiler/testData/debug/stepping/class.kt index 5efb80a9779..9b272ba52ec 100644 --- a/compiler/testData/debug/stepping/class.kt +++ b/compiler/testData/debug/stepping/class.kt @@ -37,4 +37,7 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:12 box // test.kt:4 -// test.kt:14 box \ No newline at end of file +// test.kt:3 +// test.kt:14 box +// test.kt:8 foo +// test.kt:15 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/classObject.kt b/compiler/testData/debug/stepping/classObject.kt index 78606ed1885..ad3b7b0dcc5 100644 --- a/compiler/testData/debug/stepping/classObject.kt +++ b/compiler/testData/debug/stepping/classObject.kt @@ -42,7 +42,9 @@ fun box() { // test.kt:14 box // test.kt:5 // test.kt:6 +// test.kt:4 // test.kt:15 box // test.kt:16 box // test.kt:16 box -// test.kt:8 foo \ No newline at end of file +// test.kt:8 foo +// test.kt:17 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/compileTimeConstant.kt b/compiler/testData/debug/stepping/compileTimeConstant.kt index b02068bdf56..bc3127c4314 100644 --- a/compiler/testData/debug/stepping/compileTimeConstant.kt +++ b/compiler/testData/debug/stepping/compileTimeConstant.kt @@ -12,3 +12,4 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:5 box +// test.kt:6 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/conjunction.kt b/compiler/testData/debug/stepping/conjunction.kt index d3d12e0a087..232830342cd 100644 --- a/compiler/testData/debug/stepping/conjunction.kt +++ b/compiler/testData/debug/stepping/conjunction.kt @@ -34,3 +34,4 @@ fun getD() = true // EXPECTATIONS JS_IR // test.kt:3 box +// test.kt:11 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/constantConditions.kt b/compiler/testData/debug/stepping/constantConditions.kt index eaaec2fcb80..d3e67ce813e 100644 --- a/compiler/testData/debug/stepping/constantConditions.kt +++ b/compiler/testData/debug/stepping/constantConditions.kt @@ -27,3 +27,4 @@ fun test(): Long { // EXPECTATIONS JS_IR // test.kt:5 box // test.kt:11 test +// test.kt:6 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/constructorCall.kt b/compiler/testData/debug/stepping/constructorCall.kt index 265233b076e..ee0cc93ba56 100644 --- a/compiler/testData/debug/stepping/constructorCall.kt +++ b/compiler/testData/debug/stepping/constructorCall.kt @@ -35,9 +35,14 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:6 box // test.kt:3 +// test.kt:3 // test.kt:7 box // test.kt:3 +// test.kt:3 // test.kt:10 box // test.kt:3 +// test.kt:3 // test.kt:12 box -// test.kt:3 \ No newline at end of file +// test.kt:3 +// test.kt:3 +// test.kt:14 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/constructors.kt b/compiler/testData/debug/stepping/constructors.kt index 336704c2639..f7ffb34a8b3 100644 --- a/compiler/testData/debug/stepping/constructors.kt +++ b/compiler/testData/debug/stepping/constructors.kt @@ -187,35 +187,49 @@ class O(i: T) { // EXPECTATIONS JS_IR // test.kt:4 box +// test.kt:19 // test.kt:5 box // test.kt:20 +// test.kt:20 // test.kt:6 box // test.kt:22 D_init_$Init$ +// test.kt:21 D // test.kt:7 box // test.kt:25 E_init_$Init$ +// test.kt:24 E // test.kt:8 box // test.kt:28 F_init_$Init$ +// test.kt:27 F // test.kt:29 F_init_$Init$ // test.kt:9 box // test.kt:33 G_init_$Init$ +// test.kt:32 G // test.kt:34 G_init_$Init$ // test.kt:10 box // test.kt:39 +// test.kt:37 // test.kt:11 box // test.kt:42 // test.kt:44 +// test.kt:42 // test.kt:12 box // test.kt:48 L_init_$Init$ // test.kt:53 L +// test.kt:47 L // test.kt:49 L_init_$Init$ // test.kt:13 box // test.kt:57 M_init_$Init$ // test.kt:61 M_init_$Init$_0 +// test.kt:56 M // test.kt:58 M_init_$Init$ // test.kt:14 box // test.kt:65 N_init_$Init$ // test.kt:69 N_init_$Init$_0 +// test.kt:64 N // test.kt:66 N_init_$Init$ // test.kt:15 box +// test.kt:72 // test.kt:16 box -// test.kt:73 O_init_$Init$ \ No newline at end of file +// test.kt:73 O_init_$Init$ +// test.kt:72 +// test.kt:17 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/dataClass.kt b/compiler/testData/debug/stepping/dataClass.kt index 42270738568..f7da0236268 100644 --- a/compiler/testData/debug/stepping/dataClass.kt +++ b/compiler/testData/debug/stepping/dataClass.kt @@ -64,9 +64,11 @@ fun box() { // test.kt:13 box // test.kt:3 // test.kt:3 +// test.kt:3 // test.kt:14 box // test.kt:3 // test.kt:3 +// test.kt:3 // test.kt:14 box // test.kt:1 equals // test.kt:1 equals @@ -87,16 +89,18 @@ fun box() { // test.kt:18 box // test.kt:1 copy$default // test.kt:1 copy$default -// test.kt:1 copy$default // test.kt:1 copy // test.kt:3 // test.kt:3 +// test.kt:3 // test.kt:19 box // test.kt:5 // test.kt:5 +// test.kt:5 // test.kt:20 box // test.kt:5 // test.kt:5 +// test.kt:5 // test.kt:20 box // test.kt:7 equals // test.kt:21 box @@ -111,4 +115,6 @@ fun box() { // test.kt:24 box // test.kt:9 copy // test.kt:5 -// test.kt:5 \ No newline at end of file +// test.kt:5 +// test.kt:5 +// test.kt:25 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/defaultParameter.kt b/compiler/testData/debug/stepping/defaultParameter.kt index 4db4d45c0ea..4b66ac28004 100644 --- a/compiler/testData/debug/stepping/defaultParameter.kt +++ b/compiler/testData/debug/stepping/defaultParameter.kt @@ -25,9 +25,11 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:11 box +// test.kt:3 // test.kt:11 box -// test.kt:6 foo$default // test.kt:4 computeParam // test.kt:6 foo$default // test.kt:6 foo$default -// test.kt:6 foo$default \ No newline at end of file +// test.kt:7 foo +// test.kt:6 foo$default +// test.kt:12 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/enum.kt b/compiler/testData/debug/stepping/enum.kt index 13cbef7e037..40f9c4ebf13 100644 --- a/compiler/testData/debug/stepping/enum.kt +++ b/compiler/testData/debug/stepping/enum.kt @@ -55,11 +55,15 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:22 box // test.kt:11 +// test.kt:3 // test.kt:11 +// test.kt:3 // test.kt:22 box // test.kt:9 foo -// test.kt:7 E$foo$lambda // test.kt:15 E2_initEntries // test.kt:14 +// test.kt:14 // test.kt:17 E2_initEntries -// test.kt:14 \ No newline at end of file +// test.kt:14 +// test.kt:14 +// test.kt:24 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/for.kt b/compiler/testData/debug/stepping/for.kt index 8313a8885ee..f5ff44c680a 100644 --- a/compiler/testData/debug/stepping/for.kt +++ b/compiler/testData/debug/stepping/for.kt @@ -31,3 +31,4 @@ inline fun foo(n: Int) {} // test.kt:3 box // test.kt:3 box // test.kt:3 box +// test.kt:6 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/functionCallWithDefault.kt b/compiler/testData/debug/stepping/functionCallWithDefault.kt index 95641fe6310..a62cda3de6a 100644 --- a/compiler/testData/debug/stepping/functionCallWithDefault.kt +++ b/compiler/testData/debug/stepping/functionCallWithDefault.kt @@ -24,4 +24,5 @@ inline fun bar(i: Int = 1) { // EXPECTATIONS JS_IR // test.kt:4 box -// test.kt:8 foo \ No newline at end of file +// test.kt:8 foo +// test.kt:6 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/functionCallWithLambdaParam.kt b/compiler/testData/debug/stepping/functionCallWithLambdaParam.kt index 9f62f376a91..f2d375b7b68 100644 --- a/compiler/testData/debug/stepping/functionCallWithLambdaParam.kt +++ b/compiler/testData/debug/stepping/functionCallWithLambdaParam.kt @@ -33,6 +33,11 @@ fun foo(f: () -> Unit) { // test.kt:4 box // test.kt:14 foo // test.kt:5 box$lambda +// test.kt:6 box$lambda +// test.kt:15 foo // test.kt:8 box // test.kt:14 foo -// test.kt:9 box$lambda \ No newline at end of file +// test.kt:9 box$lambda +// test.kt:10 box$lambda +// test.kt:15 foo +// test.kt:11 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/functionInAnotherFile.kt b/compiler/testData/debug/stepping/functionInAnotherFile.kt index 1a9afb56f65..ec23df384ca 100644 --- a/compiler/testData/debug/stepping/functionInAnotherFile.kt +++ b/compiler/testData/debug/stepping/functionInAnotherFile.kt @@ -43,3 +43,4 @@ fun bar(x: Int) = // foo.kt:4 foo // foo.kt:5 foo // test.kt:21 bar +// test.kt:14 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/if2.kt b/compiler/testData/debug/stepping/if2.kt index 787744dfdbe..efde4b025b2 100644 --- a/compiler/testData/debug/stepping/if2.kt +++ b/compiler/testData/debug/stepping/if2.kt @@ -43,7 +43,10 @@ fun box() { // test.kt:4 foo // test.kt:8 foo // test.kt:12 foo +// test.kt:17 foo // test.kt:21 box // test.kt:4 foo // test.kt:8 foo // test.kt:12 foo +// test.kt:17 foo +// test.kt:22 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/ifThen.kt b/compiler/testData/debug/stepping/ifThen.kt index 7b2c9fe0b23..18a7ebecfda 100644 --- a/compiler/testData/debug/stepping/ifThen.kt +++ b/compiler/testData/debug/stepping/ifThen.kt @@ -31,3 +31,5 @@ fun box() { // test.kt:13 box // test.kt:14 box // test.kt:4 foo +// test.kt:7 foo +// test.kt:15 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/ifThenElse.kt b/compiler/testData/debug/stepping/ifThenElse.kt index 9e7ded73eca..ec10bd2f7e2 100644 --- a/compiler/testData/debug/stepping/ifThenElse.kt +++ b/compiler/testData/debug/stepping/ifThenElse.kt @@ -46,9 +46,12 @@ fun box() { // test.kt:10 foo // test.kt:11 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:21 box // test.kt:22 box // test.kt:4 foo // test.kt:10 foo // test.kt:13 foo // test.kt:10 foo +// test.kt:15 foo +// test.kt:23 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/ifThenElseFalse.kt b/compiler/testData/debug/stepping/ifThenElseFalse.kt index 08ad26c13ce..1e52a23b29a 100644 --- a/compiler/testData/debug/stepping/ifThenElseFalse.kt +++ b/compiler/testData/debug/stepping/ifThenElseFalse.kt @@ -39,9 +39,12 @@ fun box() { // test.kt:15 box // test.kt:8 foo // test.kt:5 cond +// test.kt:12 foo // test.kt:16 box // test.kt:17 box // test.kt:8 foo // test.kt:5 cond // test.kt:9 foo // test.kt:5 cond +// test.kt:12 foo +// test.kt:18 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/ifWithInlineInCondition.kt b/compiler/testData/debug/stepping/ifWithInlineInCondition.kt index 8936c182542..2da0c4d4bf3 100644 --- a/compiler/testData/debug/stepping/ifWithInlineInCondition.kt +++ b/compiler/testData/debug/stepping/ifWithInlineInCondition.kt @@ -58,15 +58,20 @@ fun nop() {} // EXPECTATIONS JS_IR // test.kt:3 box // test.kt:4 box +// test.kt:30 nop // test.kt:24 box // test.kt:8 box // test.kt:28 box // test.kt:8 box // test.kt:24 box // test.kt:9 box +// test.kt:10 box // test.kt:11 box +// test.kt:30 nop // test.kt:24 box // test.kt:16 box // test.kt:27 box // test.kt:15 box // test.kt:19 box +// test.kt:30 nop +// test.kt:21 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/iincStepping.kt b/compiler/testData/debug/stepping/iincStepping.kt index 75f649341f7..163f9ae11d3 100644 --- a/compiler/testData/debug/stepping/iincStepping.kt +++ b/compiler/testData/debug/stepping/iincStepping.kt @@ -56,3 +56,4 @@ fun box() { // test.kt:12 box // test.kt:14 box // test.kt:16 box +// test.kt:18 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/initBlocks.kt b/compiler/testData/debug/stepping/initBlocks.kt index 456445f43ff..592f8e5228a 100644 --- a/compiler/testData/debug/stepping/initBlocks.kt +++ b/compiler/testData/debug/stepping/initBlocks.kt @@ -111,16 +111,21 @@ fun box() { // test.kt:48 box // test.kt:7 // test.kt:45 x +// test.kt:3 // test.kt:49 box // test.kt:13 // test.kt:17 +// test.kt:11 // test.kt:50 box // test.kt:23 // test.kt:26 // test.kt:45 x // test.kt:29 +// test.kt:21 // test.kt:51 box // test.kt:34 // test.kt:36 // test.kt:39 -// test.kt:42 \ No newline at end of file +// test.kt:42 +// test.kt:33 +// test.kt:52 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/initBlocksCompanion.kt b/compiler/testData/debug/stepping/initBlocksCompanion.kt index 5779e7e6342..1a343d92f03 100644 --- a/compiler/testData/debug/stepping/initBlocksCompanion.kt +++ b/compiler/testData/debug/stepping/initBlocksCompanion.kt @@ -60,4 +60,6 @@ fun box() { // test.kt:13 // test.kt:16 // test.kt:21 -// test.kt:30 box \ No newline at end of file +// test.kt:4 +// test.kt:30 box +// test.kt:31 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/inlineCallableReference.kt b/compiler/testData/debug/stepping/inlineCallableReference.kt index 502d0f82677..74d48b16989 100644 --- a/compiler/testData/debug/stepping/inlineCallableReference.kt +++ b/compiler/testData/debug/stepping/inlineCallableReference.kt @@ -39,3 +39,4 @@ inline fun f(block: () -> Unit) { // test.kt:5 box // test.kt:8 box // test.kt:10 box +// test.kt:12 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/inlineNamedCallableReference.kt b/compiler/testData/debug/stepping/inlineNamedCallableReference.kt index d0fe223ba2f..36d15fa2f5e 100644 --- a/compiler/testData/debug/stepping/inlineNamedCallableReference.kt +++ b/compiler/testData/debug/stepping/inlineNamedCallableReference.kt @@ -23,3 +23,5 @@ fun g() {} // EXPECTATIONS JS_IR // test.kt:3 box // test.kt:8 box +// test.kt:11 g +// test.kt:5 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/jsCode.kt b/compiler/testData/debug/stepping/jsCode.kt index 6f19d0f809c..1a032e118c4 100644 --- a/compiler/testData/debug/stepping/jsCode.kt +++ b/compiler/testData/debug/stepping/jsCode.kt @@ -57,6 +57,7 @@ fun box() { // EXPECTATIONS // test.kt:39 box +// test.kt:36 noop // test.kt:41 box // test.kt:42 box // a.kt:11 box @@ -78,3 +79,4 @@ fun box() { // a.kt:6 exclamate // a.kt:29 box // a.kt:22 value +// test.kt:56 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/kt15259.kt b/compiler/testData/debug/stepping/kt15259.kt index e90f412be23..f8544a3e2dd 100644 --- a/compiler/testData/debug/stepping/kt15259.kt +++ b/compiler/testData/debug/stepping/kt15259.kt @@ -26,3 +26,5 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:12 box // test.kt:9 makeFace +// test.kt:6 +// test.kt:13 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/kt29179.kt b/compiler/testData/debug/stepping/kt29179.kt index 4da15be69d6..34d972afba9 100644 --- a/compiler/testData/debug/stepping/kt29179.kt +++ b/compiler/testData/debug/stepping/kt29179.kt @@ -28,4 +28,7 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:15 box // test.kt:5 -// test.kt:15 box \ No newline at end of file +// test.kt:4 +// test.kt:15 box +// test.kt:11 foo +// test.kt:16 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/kt42208.kt b/compiler/testData/debug/stepping/kt42208.kt index afff7be91b3..eb3e64c0ce2 100644 --- a/compiler/testData/debug/stepping/kt42208.kt +++ b/compiler/testData/debug/stepping/kt42208.kt @@ -21,3 +21,4 @@ inline fun foo() = { // EXPECTATIONS JS_IR // test.kt:4 box // test1.kt:6 box$lambda +// test.kt:5 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/kt42208b.kt b/compiler/testData/debug/stepping/kt42208b.kt index f1b1071c730..f17b728d31c 100644 --- a/compiler/testData/debug/stepping/kt42208b.kt +++ b/compiler/testData/debug/stepping/kt42208b.kt @@ -28,3 +28,4 @@ inline fun foo() = { // test.kt:4 box // test.kt:5 box // test1.kt:7 box$lambda +// test.kt:6 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/kt42208c.kt b/compiler/testData/debug/stepping/kt42208c.kt index 9a115331a0d..40fe0bf3138 100644 --- a/compiler/testData/debug/stepping/kt42208c.kt +++ b/compiler/testData/debug/stepping/kt42208c.kt @@ -41,8 +41,11 @@ fun baz(v:(() -> Unit)) { // test.kt:4 box // test3.kt:14 baz // test1.kt:8 box$lambda +// test3.kt:15 baz // test1.kt:11 box // test.kt:5 box // test.kt:6 box // test3.kt:14 baz -// test1.kt:8 box$lambda \ No newline at end of file +// test1.kt:8 box$lambda +// test3.kt:15 baz +// test.kt:7 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/lineNumberAfterInline.kt b/compiler/testData/debug/stepping/lineNumberAfterInline.kt index df5da65cc63..cc025d6e300 100644 --- a/compiler/testData/debug/stepping/lineNumberAfterInline.kt +++ b/compiler/testData/debug/stepping/lineNumberAfterInline.kt @@ -40,5 +40,9 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:22 box +// test.kt:14 test1 // test.kt:23 box // test.kt:17 test2 +// test.kt:5 normalFunction +// test.kt:19 test2 +// test.kt:24 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/multiModule.kt b/compiler/testData/debug/stepping/multiModule.kt index 6bc006668d5..b4428723159 100644 --- a/compiler/testData/debug/stepping/multiModule.kt +++ b/compiler/testData/debug/stepping/multiModule.kt @@ -29,3 +29,4 @@ fun box() { // a.kt:4 a // test.kt:15 box // b.kt:8 b +// test.kt:16 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/multilineExpression.kt b/compiler/testData/debug/stepping/multilineExpression.kt index 8b0efd0e5e0..731e6ad10dd 100644 --- a/compiler/testData/debug/stepping/multilineExpression.kt +++ b/compiler/testData/debug/stepping/multilineExpression.kt @@ -25,3 +25,4 @@ fun test(a: Boolean, b: Boolean, c: Boolean): Boolean { // EXPECTATIONS JS_IR // test.kt:5 box // test.kt:9 test +// test.kt:6 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/multilineFunctionCall.kt b/compiler/testData/debug/stepping/multilineFunctionCall.kt index 657180b3249..fdcda372485 100644 --- a/compiler/testData/debug/stepping/multilineFunctionCall.kt +++ b/compiler/testData/debug/stepping/multilineFunctionCall.kt @@ -17,3 +17,5 @@ fun foo(i: Int) { // EXPECTATIONS JS_IR // test.kt:4 box +// test.kt:10 foo +// test.kt:7 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/multilineInfixCall.kt b/compiler/testData/debug/stepping/multilineInfixCall.kt index cceb164c404..17bbe1d1a3c 100644 --- a/compiler/testData/debug/stepping/multilineInfixCall.kt +++ b/compiler/testData/debug/stepping/multilineInfixCall.kt @@ -17,3 +17,5 @@ infix fun Int.foo(i: Int) { // EXPECTATIONS JS_IR // test.kt:4 box +// test.kt:9 foo +// test.kt:6 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/namedCallableReference.kt b/compiler/testData/debug/stepping/namedCallableReference.kt index 0e9bd69a44b..113219c539a 100644 --- a/compiler/testData/debug/stepping/namedCallableReference.kt +++ b/compiler/testData/debug/stepping/namedCallableReference.kt @@ -32,8 +32,10 @@ fun g() {} // EXPECTATIONS JS_IR // test.kt:3 box // test.kt:4 box -// test.kt:4 g$ref // test.kt:4 box // test.kt:8 f // test.kt:4 g$ref$lambda -// test.kt:4 g$ref$lambda \ No newline at end of file +// test.kt:11 g +// test.kt:4 g$ref$lambda +// test.kt:9 f +// test.kt:5 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/nullcheck.kt b/compiler/testData/debug/stepping/nullcheck.kt index 0c62c3d0088..d725d898b95 100644 --- a/compiler/testData/debug/stepping/nullcheck.kt +++ b/compiler/testData/debug/stepping/nullcheck.kt @@ -75,3 +75,4 @@ fun testExpressionBody(nullable: String?) = // test.kt:21 testExpressionBody // test.kt:9 box // test.kt:21 testExpressionBody +// test.kt:10 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/propertyAccessor.kt b/compiler/testData/debug/stepping/propertyAccessor.kt index cdfab7f7aba..e31b14669d8 100644 --- a/compiler/testData/debug/stepping/propertyAccessor.kt +++ b/compiler/testData/debug/stepping/propertyAccessor.kt @@ -21,5 +21,7 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:11 box +// test.kt:3 // test.kt:11 box -// test.kt:6 \ No newline at end of file +// test.kt:6 +// test.kt:12 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/psvm.kt b/compiler/testData/debug/stepping/psvm.kt index 0de0f179931..2f4676396cb 100644 --- a/compiler/testData/debug/stepping/psvm.kt +++ b/compiler/testData/debug/stepping/psvm.kt @@ -17,3 +17,5 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:8 box // test.kt:4 main +// test.kt:5 main +// test.kt:9 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/recursion.kt b/compiler/testData/debug/stepping/recursion.kt index b7b4bc52585..560da9eeed8 100644 --- a/compiler/testData/debug/stepping/recursion.kt +++ b/compiler/testData/debug/stepping/recursion.kt @@ -36,3 +36,4 @@ fun foo(n :Int ) : Int { // test.kt:9 foo // test.kt:11 foo // test.kt:11 foo +// test.kt:5 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/smapInlineAsArgument.kt b/compiler/testData/debug/stepping/smapInlineAsArgument.kt index 45421c7635f..9cf88392bf8 100644 --- a/compiler/testData/debug/stepping/smapInlineAsArgument.kt +++ b/compiler/testData/debug/stepping/smapInlineAsArgument.kt @@ -41,7 +41,10 @@ fun fail() : String { // test.kt:4 box // test.kt:20 fail // test.kt:4 box +// test.kt:13 checkEquals // test.kt:7 box // test.kt:20 fail // test.kt:16 box // test.kt:7 box +// test.kt:13 checkEquals +// test.kt:9 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/smapInlineAsInfixArgument.kt b/compiler/testData/debug/stepping/smapInlineAsInfixArgument.kt index 2fb3ed91587..cf27fa42587 100644 --- a/compiler/testData/debug/stepping/smapInlineAsInfixArgument.kt +++ b/compiler/testData/debug/stepping/smapInlineAsInfixArgument.kt @@ -45,3 +45,4 @@ fun fail() : String { // test.kt:14 box // test.kt:9 box // test.kt:3 execute +// test.kt:11 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/smapInlineAsInlineArgument.kt b/compiler/testData/debug/stepping/smapInlineAsInlineArgument.kt index 6c85b910956..ce5005fd043 100644 --- a/compiler/testData/debug/stepping/smapInlineAsInlineArgument.kt +++ b/compiler/testData/debug/stepping/smapInlineAsInlineArgument.kt @@ -47,3 +47,4 @@ fun fail() : String { // test.kt:16 box // test.kt:8 box // test.kt:16 box +// test.kt:9 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/smapInlineInIntrinsicArgument.kt b/compiler/testData/debug/stepping/smapInlineInIntrinsicArgument.kt index 8d104117df3..a5bdaaeb6e3 100644 --- a/compiler/testData/debug/stepping/smapInlineInIntrinsicArgument.kt +++ b/compiler/testData/debug/stepping/smapInlineInIntrinsicArgument.kt @@ -43,3 +43,4 @@ fun fail() : String { // test.kt:16 fail // test.kt:12 box // test.kt:7 box +// test.kt:9 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/stringSwitches.kt b/compiler/testData/debug/stepping/stringSwitches.kt index ac72419a998..0a4e856dda9 100644 --- a/compiler/testData/debug/stepping/stringSwitches.kt +++ b/compiler/testData/debug/stepping/stringSwitches.kt @@ -119,21 +119,26 @@ fun box() { // test.kt:12 stringSwitch // test.kt:19 stringSwitch // test.kt:21 stringSwitch +// test.kt:26 stringSwitch // test.kt:30 box // test.kt:6 stringSwitch // test.kt:11 stringSwitch // test.kt:13 stringSwitch // test.kt:19 stringSwitch // test.kt:22 stringSwitch +// test.kt:26 stringSwitch // test.kt:31 box // test.kt:7 stringSwitch // test.kt:11 stringSwitch // test.kt:14 stringSwitch // test.kt:19 stringSwitch // test.kt:23 stringSwitch +// test.kt:26 stringSwitch // test.kt:32 box // test.kt:8 stringSwitch // test.kt:11 stringSwitch // test.kt:15 stringSwitch // test.kt:19 stringSwitch // test.kt:24 stringSwitch +// test.kt:26 stringSwitch +// test.kt:33 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/stringSwitchesSmall.kt b/compiler/testData/debug/stepping/stringSwitchesSmall.kt index 779a759e88b..2610c78bb24 100644 --- a/compiler/testData/debug/stepping/stringSwitchesSmall.kt +++ b/compiler/testData/debug/stepping/stringSwitchesSmall.kt @@ -102,15 +102,19 @@ fun box() { // test.kt:11 stringSwitch // test.kt:17 stringSwitch // test.kt:19 stringSwitch +// test.kt:23 stringSwitch // test.kt:27 box // test.kt:6 stringSwitch // test.kt:10 stringSwitch // test.kt:12 stringSwitch // test.kt:17 stringSwitch // test.kt:20 stringSwitch +// test.kt:23 stringSwitch // test.kt:28 box // test.kt:7 stringSwitch // test.kt:10 stringSwitch // test.kt:13 stringSwitch // test.kt:17 stringSwitch // test.kt:21 stringSwitch +// test.kt:23 stringSwitch +// test.kt:29 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/throwException.kt b/compiler/testData/debug/stepping/throwException.kt index bce1e77a5d4..de63e180f49 100644 --- a/compiler/testData/debug/stepping/throwException.kt +++ b/compiler/testData/debug/stepping/throwException.kt @@ -32,6 +32,7 @@ fun throwIfLess(a: Int, b: Int) { // test.kt:6 box // test.kt:14 throwIfLess // test.kt:15 throwIfLess +// test.kt:7 box // test.kt:8 box // test.kt:14 throwIfLess -// test.kt:15 throwIfLess +// test.kt:15 throwIfLess \ No newline at end of file diff --git a/compiler/testData/debug/stepping/topLevel.kt b/compiler/testData/debug/stepping/topLevel.kt index da384efda15..017a07c0f46 100644 --- a/compiler/testData/debug/stepping/topLevel.kt +++ b/compiler/testData/debug/stepping/topLevel.kt @@ -17,3 +17,4 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:8 box // test.kt:3 foo +// test.kt:9 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/trait.kt b/compiler/testData/debug/stepping/trait.kt index 1ad2fef37db..a2a4ba3e2a5 100644 --- a/compiler/testData/debug/stepping/trait.kt +++ b/compiler/testData/debug/stepping/trait.kt @@ -46,10 +46,13 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:14 box +// test.kt:14 // test.kt:14 box // test.kt:7 bar // test.kt:4 foo // test.kt:15 box +// test.kt:11 // test.kt:15 box // test.kt:7 bar // test.kt:4 foo +// test.kt:16 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/tryCatch.kt b/compiler/testData/debug/stepping/tryCatch.kt index d65dac5aff5..6c22d36337a 100644 --- a/compiler/testData/debug/stepping/tryCatch.kt +++ b/compiler/testData/debug/stepping/tryCatch.kt @@ -32,6 +32,10 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:13 box // test.kt:5 foo +// test.kt:10 foo // test.kt:14 box // test.kt:5 foo // test.kt:5 foo +// test.kt:6 foo +// test.kt:10 foo +// test.kt:15 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/tryFinally.kt b/compiler/testData/debug/stepping/tryFinally.kt index a7601bc8def..bedf6b38172 100644 --- a/compiler/testData/debug/stepping/tryFinally.kt +++ b/compiler/testData/debug/stepping/tryFinally.kt @@ -79,13 +79,17 @@ fun box() { // test.kt:29 box // test.kt:5 foo // test.kt:21 mightThrow +// test.kt:22 mightThrow // test.kt:11 foo // test.kt:25 mightThrow2 +// test.kt:26 mightThrow2 // test.kt:10 foo +// test.kt:15 foo // test.kt:30 box // test.kt:31 box // test.kt:5 foo // test.kt:21 mightThrow +// test.kt:22 mightThrow // test.kt:11 foo // test.kt:25 mightThrow2 -// test.kt:25 mightThrow2 +// test.kt:25 mightThrow2 \ No newline at end of file diff --git a/compiler/testData/debug/stepping/variablesWithoutInitializer.kt b/compiler/testData/debug/stepping/variablesWithoutInitializer.kt index aebae78b6a9..474129ca397 100644 --- a/compiler/testData/debug/stepping/variablesWithoutInitializer.kt +++ b/compiler/testData/debug/stepping/variablesWithoutInitializer.kt @@ -32,3 +32,4 @@ fun box() { // test.kt:8 box // test.kt:9 box // test.kt:10 box +// test.kt:12 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/when.kt b/compiler/testData/debug/stepping/when.kt index 0e956010f5a..edf6f4100df 100644 --- a/compiler/testData/debug/stepping/when.kt +++ b/compiler/testData/debug/stepping/when.kt @@ -125,16 +125,24 @@ fun box() { // test.kt:6 foo // test.kt:13 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:12 foo // test.kt:13 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:11 foo // test.kt:6 foo // test.kt:13 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:12 foo // test.kt:13 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:10 foo +// test.kt:15 foo +// test.kt:19 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/whenComplicatedSubject.kt b/compiler/testData/debug/stepping/whenComplicatedSubject.kt index 6b9d65427c6..d7db55d09d2 100644 --- a/compiler/testData/debug/stepping/whenComplicatedSubject.kt +++ b/compiler/testData/debug/stepping/whenComplicatedSubject.kt @@ -53,10 +53,14 @@ fun box() { // test.kt:6 foo // test.kt:10 foo // test.kt:11 foo +// test.kt:13 foo // test.kt:17 box // test.kt:7 foo // test.kt:10 foo // test.kt:11 foo +// test.kt:13 foo // test.kt:18 box // test.kt:8 foo // test.kt:10 foo +// test.kt:13 foo +// test.kt:19 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/whenConstant.kt b/compiler/testData/debug/stepping/whenConstant.kt index 523cf7960d1..2a1155f9c1b 100644 --- a/compiler/testData/debug/stepping/whenConstant.kt +++ b/compiler/testData/debug/stepping/whenConstant.kt @@ -24,3 +24,4 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:4 box +// test.kt:12 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/whenIsChecks.kt b/compiler/testData/debug/stepping/whenIsChecks.kt index cec210c1346..56dfe49e580 100644 --- a/compiler/testData/debug/stepping/whenIsChecks.kt +++ b/compiler/testData/debug/stepping/whenIsChecks.kt @@ -41,9 +41,13 @@ fun box() { // test.kt:15 box // test.kt:4 foo // test.kt:5 foo +// test.kt:12 foo // test.kt:16 box // test.kt:4 foo // test.kt:5 foo +// test.kt:12 foo // test.kt:17 box // test.kt:4 foo // test.kt:5 foo +// test.kt:12 foo +// test.kt:18 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/whenMultiLine.kt b/compiler/testData/debug/stepping/whenMultiLine.kt index aaa0ecd7564..edb195d8537 100644 --- a/compiler/testData/debug/stepping/whenMultiLine.kt +++ b/compiler/testData/debug/stepping/whenMultiLine.kt @@ -92,3 +92,4 @@ fun box() { // test.kt:28 box // test.kt:19 foo // test.kt:22 foo +// test.kt:29 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/whenMultiLineSubject.kt b/compiler/testData/debug/stepping/whenMultiLineSubject.kt index 13424258c6d..b1946fed065 100644 --- a/compiler/testData/debug/stepping/whenMultiLineSubject.kt +++ b/compiler/testData/debug/stepping/whenMultiLineSubject.kt @@ -71,3 +71,4 @@ fun box() { // test.kt:13 foo // test.kt:19 foo // test.kt:22 foo +// test.kt:29 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/whenNullalbeSubject.kt b/compiler/testData/debug/stepping/whenNullalbeSubject.kt index 993fbf25426..63e06843ba6 100644 --- a/compiler/testData/debug/stepping/whenNullalbeSubject.kt +++ b/compiler/testData/debug/stepping/whenNullalbeSubject.kt @@ -26,3 +26,4 @@ fun box() { // EXPECTATIONS JS_IR // test.kt:4 box // test.kt:5 box +// test.kt:16 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/whenSubject.kt b/compiler/testData/debug/stepping/whenSubject.kt index 781d0028a2f..2565a4906e5 100644 --- a/compiler/testData/debug/stepping/whenSubject.kt +++ b/compiler/testData/debug/stepping/whenSubject.kt @@ -80,13 +80,16 @@ fun box() { // test.kt:10 foo // test.kt:13 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:10 foo // test.kt:12 foo // test.kt:4 foo // test.kt:10 foo // test.kt:13 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:10 foo // test.kt:11 foo // test.kt:4 foo @@ -95,11 +98,16 @@ fun box() { // test.kt:10 foo // test.kt:13 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:10 foo // test.kt:12 foo // test.kt:4 foo // test.kt:10 foo // test.kt:13 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:10 foo +// test.kt:15 foo // test.kt:10 foo +// test.kt:15 foo +// test.kt:19 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/whenSubject2.kt b/compiler/testData/debug/stepping/whenSubject2.kt index dcf64a50c96..65a96a38cbe 100644 --- a/compiler/testData/debug/stepping/whenSubject2.kt +++ b/compiler/testData/debug/stepping/whenSubject2.kt @@ -130,13 +130,16 @@ fun box() { // test.kt:13 foo // test.kt:17 foo // test.kt:12 foo +// test.kt:19 foo // test.kt:13 foo // test.kt:16 foo // test.kt:5 foo // test.kt:13 foo // test.kt:17 foo // test.kt:12 foo +// test.kt:19 foo // test.kt:12 foo +// test.kt:19 foo // test.kt:13 foo // test.kt:15 foo // test.kt:5 foo @@ -145,11 +148,16 @@ fun box() { // test.kt:13 foo // test.kt:17 foo // test.kt:12 foo +// test.kt:19 foo // test.kt:13 foo // test.kt:16 foo // test.kt:5 foo // test.kt:13 foo // test.kt:17 foo // test.kt:12 foo +// test.kt:19 foo // test.kt:12 foo +// test.kt:19 foo // test.kt:12 foo +// test.kt:19 foo +// test.kt:23 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/whenWithInlineInCondition.kt b/compiler/testData/debug/stepping/whenWithInlineInCondition.kt index 6464ac4e6f4..4326dac6cfd 100644 --- a/compiler/testData/debug/stepping/whenWithInlineInCondition.kt +++ b/compiler/testData/debug/stepping/whenWithInlineInCondition.kt @@ -81,6 +81,7 @@ fun nop() {} // test.kt:22 box // test.kt:7 box // test.kt:7 box +// test.kt:28 nop // test.kt:20 box // test.kt:12 box // test.kt:21 box @@ -94,3 +95,5 @@ fun nop() {} // test.kt:25 box // test.kt:14 box // test.kt:14 box +// test.kt:28 nop +// test.kt:17 box \ No newline at end of file diff --git a/compiler/testData/debug/stepping/while.kt b/compiler/testData/debug/stepping/while.kt index ae30b3e69e7..1214f3cd27f 100644 --- a/compiler/testData/debug/stepping/while.kt +++ b/compiler/testData/debug/stepping/while.kt @@ -35,3 +35,4 @@ fun box() { // test.kt:12 box // test.kt:12 box // test.kt:12 box +// test.kt:13 box \ No newline at end of file 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 99a4c391ab4..4bad325d50b 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 @@ -4,7 +4,6 @@ package org.jetbrains.kotlin.js.backend; -import com.intellij.openapi.util.text.StringUtil; import kotlin.text.StringsKt; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.js.backend.ast.*; @@ -377,8 +376,8 @@ public class JsToStringGenerationVisitor extends JsVisitor { @Override public void visitCatch(@NotNull JsCatch x) { - pushSourceInfo(x.getSource()); printCommentsBeforeNode(x); + pushSourceInfo(x.getSource()); spaceOpt(); p.print(CHARS_CATCH); @@ -399,8 +398,8 @@ public class JsToStringGenerationVisitor extends JsVisitor { rightParen(); spaceOpt(); - printCommentsAfterNode(x); popSourceInfo(); + printCommentsAfterNode(x); sourceLocationConsumer.pushSourceInfo(null); accept(x.getBody()); @@ -742,8 +741,8 @@ public class JsToStringGenerationVisitor extends JsVisitor { @Override public void visitIf(@NotNull JsIf x) { - pushSourceInfo(x.getSource()); printCommentsBeforeNode(x); + pushSourceInfo(x.getSource()); _if(); spaceOpt(); @@ -751,8 +750,8 @@ public class JsToStringGenerationVisitor extends JsVisitor { accept(x.getIfExpression()); rightParen(); - printCommentsAfterNode(x); popSourceInfo(); + printCommentsAfterNode(x); JsStatement thenStmt = x.getThenStatement(); JsStatement elseStatement = x.getElseStatement(); @@ -1140,9 +1139,11 @@ public class JsToStringGenerationVisitor extends JsVisitor { @Override public void visitTry(@NotNull JsTry x) { printCommentsBeforeNode(x); + pushSourceInfo(x.getSource()); p.print(CHARS_TRY); spaceOpt(); lineBreakAfterBlock = false; + popSourceInfo(); accept(x.getTryBlock()); acceptList(x.getCatches()); @@ -1418,21 +1419,24 @@ public class JsToStringGenerationVisitor extends JsVisitor { } } - private void printJsBlock(JsBlock x, boolean finalNewline, Object closingBracketLocation) { + private void printJsBlock(JsBlock x, boolean finalNewline, @Nullable Object defaultClosingBraceLocation) { if (!lineBreakAfterBlock) { finalNewline = false; lineBreakAfterBlock = true; } - sourceLocationConsumer.pushSourceInfo(null); printCommentsBeforeNode(x); boolean needBraces = !x.isTransparent(); if (needBraces) { + sourceLocationConsumer.pushSourceInfo(x.getSource()); blockOpen(); + sourceLocationConsumer.popSourceInfo(); } + sourceLocationConsumer.pushSourceInfo(null); + Iterator iterator = x.getStatements().iterator(); while (iterator.hasNext()) { boolean isGlobal = x.isTransparent() || globalBlocks.contains(x); @@ -1454,7 +1458,6 @@ public class JsToStringGenerationVisitor extends JsVisitor { accept(statement); if (stmtIsGlobalBlock) { - //noinspection SuspiciousMethodCalls globalBlocks.remove(statement); } if (needSemi) { @@ -1494,23 +1497,28 @@ public class JsToStringGenerationVisitor extends JsVisitor { // _blockClose() modified p.indentOut(); - if (closingBracketLocation != null) { - pushSourceInfo(closingBracketLocation); + sourceLocationConsumer.popSourceInfo(); + + Object closingBraceLocation = x.getClosingBraceSource(); + if (closingBraceLocation == null) + closingBraceLocation = defaultClosingBraceLocation; + + if (closingBraceLocation != null) { + pushSourceInfo(closingBraceLocation); } p.print('}'); - if (closingBracketLocation != null) { + if (closingBraceLocation != null) { popSourceInfo(); } if (finalNewline) { newlineOpt(); } + } else { + sourceLocationConsumer.popSourceInfo(); } needSemi = false; - - printCommentsAfterNode(x); - sourceLocationConsumer.popSourceInfo(); } private void assignment() { diff --git a/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsBlock.java b/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsBlock.java index 3e662fb6bf5..6ea33f11ca6 100644 --- a/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsBlock.java +++ b/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsBlock.java @@ -4,6 +4,7 @@ package org.jetbrains.kotlin.js.backend.ast; +import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.js.util.AstUtil; import org.jetbrains.annotations.NotNull; import com.intellij.util.SmartList; @@ -17,6 +18,9 @@ public class JsBlock extends SourceInfoAwareJsNode implements JsStatement { @NotNull private final List statements; + @Nullable + private Object closingBraceSource; + public JsBlock() { this(new SmartList()); } @@ -38,6 +42,15 @@ public class JsBlock extends SourceInfoAwareJsNode implements JsStatement { return statements; } + @Nullable + public Object getClosingBraceSource() { + return closingBraceSource; + } + + public void setClosingBraceSource(@Nullable Object closingBraceLocation) { + this.closingBraceSource = closingBraceLocation; + } + public boolean isEmpty() { return statements.isEmpty(); } @@ -67,6 +80,8 @@ public class JsBlock extends SourceInfoAwareJsNode implements JsStatement { @NotNull @Override public JsBlock deepCopy() { - return new JsBlock(AstUtil.deepCopy(statements)).withMetadataFrom(this); + JsBlock block = new JsBlock(AstUtil.deepCopy(statements)).withMetadataFrom(this); + block.setClosingBraceSource(getClosingBraceSource()); + return block; } } diff --git a/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsIf.java b/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsIf.java index c1f30f4bbf6..18db0916d5a 100644 --- a/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsIf.java +++ b/js/js.ast/src/org/jetbrains/kotlin/js/backend/ast/JsIf.java @@ -21,6 +21,9 @@ public final class JsIf extends SourceInfoAwareJsNode implements JsStatement { @Nullable private JsStatement elseStatement; + @Nullable + private Object elseSource; + public JsIf(@NotNull JsExpression ifExpression, @NotNull JsStatement thenStatement, @Nullable JsStatement elseStatement) { this.ifExpression = ifExpression; this.thenStatement = thenStatement; diff --git a/js/js.translator/testData/lineNumbers/andAndWithSideEffect.kt b/js/js.translator/testData/lineNumbers/andAndWithSideEffect.kt index b2f8247520f..1f7d5db03fe 100644 --- a/js/js.translator/testData/lineNumbers/andAndWithSideEffect.kt +++ b/js/js.translator/testData/lineNumbers/andAndWithSideEffect.kt @@ -6,5 +6,5 @@ fun box(x: Int, y: Int) { fun foo(x: Int) = x -// LINES(JS): 1 5 3 3 4 3 3 3 3 * 3 3 4 4 4 4 * 4 4 4 4 2 3 7 7 7 -// LINES(JS_IR): 1 * 3 3 3 * 3 * 4 4 4 * 4 4 2 7 7 7 +// LINES(JS): 1 5 3 3 4 3 3 3 3 * 3 3 4 4 4 4 * 4 4 4 4 2 3 7 7 7 +// LINES(JS_IR): 1 1 * 3 3 3 * 3 3 * 4 4 4 * 4 4 2 7 7 7 7 diff --git a/js/js.translator/testData/lineNumbers/backingField.kt b/js/js.translator/testData/lineNumbers/backingField.kt index a279e773ab0..8fe289e72be 100644 --- a/js/js.translator/testData/lineNumbers/backingField.kt +++ b/js/js.translator/testData/lineNumbers/backingField.kt @@ -12,5 +12,5 @@ open class A { } } -// LINES(JS): 1 2 2 4 4 2 2 2 2 5 5 5 6 7 12 8 9 10 11 -// LINES(JS_IR): 1 2 2 4 4 2 2 2 2 2 2 7 8 9 10 10 11 5 6 6 5 6 +// LINES(JS): 1 2 2 4 4 2 2 2 2 5 5 5 6 7 12 8 9 10 11 +// LINES(JS_IR): 1 1 2 2 4 4 2 2 2 2 2 2 7 8 9 10 10 11 5 6 6 5 6 diff --git a/js/js.translator/testData/lineNumbers/catch.kt b/js/js.translator/testData/lineNumbers/catch.kt index dce19fe0ac7..b8728f4f9a6 100644 --- a/js/js.translator/testData/lineNumbers/catch.kt +++ b/js/js.translator/testData/lineNumbers/catch.kt @@ -19,5 +19,5 @@ fun bar() { } } -// LINES(JS): 1 11 3 3 5 5 6 6 8 8 9 9 2 2 * 13 20 15 15 18 18 -// LINES(JS_IR): 1 3 3 * 6 6 * 9 9 * 13 15 15 18 18 +// LINES(JS): 1 11 3 3 5 5 6 6 8 8 9 9 2 2 * 13 20 15 15 18 18 +// LINES(JS_IR): 1 1 3 3 5 * 6 6 * 8 9 9 * 13 13 15 15 17 18 18 diff --git a/js/js.translator/testData/lineNumbers/chainedCall.kt b/js/js.translator/testData/lineNumbers/chainedCall.kt index 33bbc126850..b92643d157d 100644 --- a/js/js.translator/testData/lineNumbers/chainedCall.kt +++ b/js/js.translator/testData/lineNumbers/chainedCall.kt @@ -14,5 +14,5 @@ class C { val baz: dynamic get() = null } -// LINES(JS): 1 9 2 4 3 2 6 8 7 6 11 12 12 12 14 14 14 -// LINES(JS_IR): 1 2 4 3 2 6 8 7 6 11 12 12 12 14 14 14 +// LINES(JS): 1 9 2 4 3 2 6 8 7 6 11 12 12 12 14 14 14 +// LINES(JS_IR): 1 1 2 4 3 2 6 8 7 6 11 11 12 12 12 14 14 14 diff --git a/js/js.translator/testData/lineNumbers/classCapturingLocals.kt b/js/js.translator/testData/lineNumbers/classCapturingLocals.kt index 20d1b79e81a..9441bbf6948 100644 --- a/js/js.translator/testData/lineNumbers/classCapturingLocals.kt +++ b/js/js.translator/testData/lineNumbers/classCapturingLocals.kt @@ -15,4 +15,4 @@ fun A.foo() { fun baz() = 23 // LINES(JS): 1 * 5 5 5 6 9 7 7 8 8 * 3 13 4 4 11 11 12 12 15 15 15 -// LINES(JS_IR): 1 3 4 4 11 11 12 12 15 15 15 5 * 6 7 7 8 8 +// LINES(JS_IR): 1 1 3 3 4 4 11 11 12 12 15 15 15 15 5 5 * 6 7 7 8 8 diff --git a/js/js.translator/testData/lineNumbers/closure.kt b/js/js.translator/testData/lineNumbers/closure.kt index 72d2bff1e03..1d711ee200d 100644 --- a/js/js.translator/testData/lineNumbers/closure.kt +++ b/js/js.translator/testData/lineNumbers/closure.kt @@ -5,5 +5,5 @@ fun box(x: Int, y: Int): Int { return foo(y) } -// LINES(JS): 2 2 2 4 4 1 6 2 2 5 5 -// LINES(JS_IR): 1 5 5 2 4 4 +// LINES(JS): 2 2 2 4 4 1 6 2 2 5 5 +// LINES(JS_IR): 1 1 5 5 2 4 4 4 diff --git a/js/js.translator/testData/lineNumbers/complexExpressionAsDefaultArgument.kt b/js/js.translator/testData/lineNumbers/complexExpressionAsDefaultArgument.kt index e6eabab33d7..e2dd11a0cd6 100644 --- a/js/js.translator/testData/lineNumbers/complexExpressionAsDefaultArgument.kt +++ b/js/js.translator/testData/lineNumbers/complexExpressionAsDefaultArgument.kt @@ -11,5 +11,5 @@ fun baz() = 1 fun bar() = 2 -// LINES(JS): 1 3 3 2 2 4 3 4 4 4 5 5 2 8 8 10 10 10 12 12 12 -// LINES(JS_IR): 1 * 1 3 3 4 5 1 * 8 8 10 10 10 12 12 12 +// LINES(JS): 1 3 3 2 2 4 3 4 4 4 5 5 2 8 8 10 10 10 12 12 12 +// LINES(JS_IR): 1 * 1 1 3 3 4 5 1 * 8 8 10 10 10 10 12 12 12 12 diff --git a/js/js.translator/testData/lineNumbers/conditionalDecomposed.kt b/js/js.translator/testData/lineNumbers/conditionalDecomposed.kt index a04be13f84f..92c2abc4129 100644 --- a/js/js.translator/testData/lineNumbers/conditionalDecomposed.kt +++ b/js/js.translator/testData/lineNumbers/conditionalDecomposed.kt @@ -14,5 +14,5 @@ private inline fun foo(): Int { return 23 } -// LINES(JS): 1 10 3 3 3 4 3 6 13 13 3 14 2 12 15 13 13 14 14 -// LINES(JS_IR): 1 * 4 6 * 13 13 14 14 8 2 12 13 13 14 14 +// LINES(JS): 1 10 3 3 3 4 3 6 13 13 3 14 2 12 15 13 13 14 14 +// LINES(JS_IR): 1 1 * 3 4 6 * 8 * 13 13 14 14 8 2 12 12 13 13 14 14 diff --git a/js/js.translator/testData/lineNumbers/coroutine.kt b/js/js.translator/testData/lineNumbers/coroutine.kt index 51849612f55..dd65cc945d9 100644 --- a/js/js.translator/testData/lineNumbers/coroutine.kt +++ b/js/js.translator/testData/lineNumbers/coroutine.kt @@ -15,4 +15,4 @@ suspend fun bar(): Unit { } // LINES(JS): 39 4 4 4 7 5 5 45 45 5 93 45 5 5 6 4 4 4 9 15 9 9 9 * 9 15 10 10 11 11 11 11 11 * 11 12 12 13 13 13 13 13 13 13 14 14 * 9 15 9 9 9 9 -// LINES(JS_IR): 4 * 19 19 * 50 50 93 93 3 45 3 45 45 6 6 19 9 9 9 9 9 9 9 9 9 9 9 9 9 * 10 10 * 11 * 11 12 12 * 13 * 13 13 14 14 +// LINES(JS_IR): 4 4 * 19 * 19 19 * 5 * 45 * 50 50 93 93 3 45 3 45 45 6 6 19 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 * 10 10 * 11 * 11 12 12 * 13 * 13 13 14 14 diff --git a/js/js.translator/testData/lineNumbers/coroutineNullAssertion.kt b/js/js.translator/testData/lineNumbers/coroutineNullAssertion.kt index 3bf6f4c961f..64e5ab0ce25 100644 --- a/js/js.translator/testData/lineNumbers/coroutineNullAssertion.kt +++ b/js/js.translator/testData/lineNumbers/coroutineNullAssertion.kt @@ -9,4 +9,4 @@ suspend fun delay() { } // LINES(JS): 1 6 1 1 * 1 6 2 2 2 2 2 * 3 3 4 4 4 4 4 5 5 * 1 6 1 1 1 1 8 9 -// LINES(JS_IR): 1 1 1 1 1 1 1 1 1 8 * 1 1 1 1 * 2 * 3 3 3 * 5 5 +// LINES(JS_IR): 1 1 1 1 1 1 1 1 1 1 8 8 * 1 1 1 1 1 * 2 * 3 3 3 * 5 5 diff --git a/js/js.translator/testData/lineNumbers/dataClass.kt b/js/js.translator/testData/lineNumbers/dataClass.kt index 6752c98d021..83cf5dd4cb5 100644 --- a/js/js.translator/testData/lineNumbers/dataClass.kt +++ b/js/js.translator/testData/lineNumbers/dataClass.kt @@ -6,4 +6,4 @@ data class A( // LINES(JS): 1 2 3 * 1 2 2 1 3 3 1 1 1 2 3 1 1 1 2 3 1 1 1 2 3 1 1 1 1 1 2 3 // FIXME: componentN function body should point to the corresponding property. -// LINES(JS_IR): 1 2 2 3 3 2 2 2 3 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 +// LINES(JS_IR): 1 1 2 2 3 3 2 2 2 3 3 3 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 diff --git a/js/js.translator/testData/lineNumbers/delegateMemberVal.kt b/js/js.translator/testData/lineNumbers/delegateMemberVal.kt index 1f27d921c8f..83c0e862808 100644 --- a/js/js.translator/testData/lineNumbers/delegateMemberVal.kt +++ b/js/js.translator/testData/lineNumbers/delegateMemberVal.kt @@ -14,4 +14,4 @@ class Delegate(val f: () -> Int) { } // LINES(JS): 1 2 3 * 2 2 3 3 3 3 * 6 8 7 7 10 10 11 13 12 12 -// LINES(JS_IR): 3 3 3 1 3 3 3 2 3 3 2 1 2 6 7 7 10 10 10 10 10 10 11 12 12 2 2 +// LINES(JS_IR): 3 3 3 3 1 1 3 3 3 2 3 3 3 2 1 2 6 6 7 7 10 10 10 10 10 10 10 11 12 12 2 2 diff --git a/js/js.translator/testData/lineNumbers/delegatedProperty.kt b/js/js.translator/testData/lineNumbers/delegatedProperty.kt index 8bf8a7dea2d..0f6b658439c 100644 --- a/js/js.translator/testData/lineNumbers/delegatedProperty.kt +++ b/js/js.translator/testData/lineNumbers/delegatedProperty.kt @@ -15,5 +15,5 @@ class B { } } -// LINES(JS): 3 4 5 * 4 4 4 * 8 9 11 10 10 13 15 14 14 -// LINES(JS_IR): 3 5 5 4 5 5 4 1 4 5 4 5 5 4 1 4 8 9 10 10 13 14 14 4 4 * 4 4 +// LINES(JS): 3 4 5 * 4 4 4 * 8 9 11 10 10 13 15 14 14 +// LINES(JS_IR): 3 3 5 5 4 5 5 5 4 1 4 5 4 5 5 5 4 1 4 8 8 9 10 10 13 14 14 4 4 * 4 4 diff --git a/js/js.translator/testData/lineNumbers/delegation.kt b/js/js.translator/testData/lineNumbers/delegation.kt index 58f79db9577..1229f7c4fb9 100644 --- a/js/js.translator/testData/lineNumbers/delegation.kt +++ b/js/js.translator/testData/lineNumbers/delegation.kt @@ -19,4 +19,4 @@ val o = object : I { } // LINES(JS): 1 2 3 2 2 2 2 2 2 2 * 11 12 12 12 15 15 15 16 18 17 17 -// LINES(JS_IR): 11 11 11 * 1 3 3 1 1 1 1 1 1 1 1 1 * 11 12 12 12 16 17 17 15 15 15 11 +// LINES(JS_IR): 11 11 11 11 * 1 1 3 3 1 1 1 1 1 1 1 1 1 5 11 11 12 12 12 16 17 17 15 15 15 11 11 diff --git a/js/js.translator/testData/lineNumbers/destructuring.kt b/js/js.translator/testData/lineNumbers/destructuring.kt index 6b4473465c5..e43857c796e 100644 --- a/js/js.translator/testData/lineNumbers/destructuring.kt +++ b/js/js.translator/testData/lineNumbers/destructuring.kt @@ -28,4 +28,4 @@ fun bar(f: (Pair) -> Unit) { // LINES(JS): 15 22 16 16 17 18 20 20 21 21 22 22 3 23 9 9 9 9 4 9 9 9 5 5 6 7 11 11 12 12 15 15 25 27 26 26 * 1 * 1 -// LINES(JS_IR): 1 1 1 1 1 1 * 3 9 9 9 9 9 6 6 9 7 7 9 11 11 12 12 15 15 25 26 26 15 17 17 16 18 18 16 20 20 21 21 * 1 +// LINES(JS_IR): 1 1 1 1 1 1 1 1 * 3 3 9 9 9 4 9 9 6 6 9 7 7 9 11 11 12 12 15 15 25 25 26 26 15 15 17 17 16 18 18 16 20 20 21 21 22 22 * 1 diff --git a/js/js.translator/testData/lineNumbers/destructuringInline.kt b/js/js.translator/testData/lineNumbers/destructuringInline.kt index a120653187a..4c5412bcb28 100644 --- a/js/js.translator/testData/lineNumbers/destructuringInline.kt +++ b/js/js.translator/testData/lineNumbers/destructuringInline.kt @@ -33,4 +33,4 @@ inline operator fun P.component1() = a inline operator fun P.component2() = b // LINES(JS): 15 22 17 17 31 18 18 33 20 20 21 21 22 22 3 23 9 9 9 9 4 9 9 9 6 6 31 7 7 33 11 11 12 12 15 15 25 27 26 26 29 29 29 * 31 31 31 33 33 33 * 1 * 1 -// LINES(JS_IR): 1 1 1 1 1 1 * 3 9 9 9 9 9 * 31 31 9 6 6 * 33 33 9 7 7 11 11 12 12 15 15 25 26 26 29 29 29 29 29 29 29 29 29 29 29 31 31 31 33 33 33 15 * 31 31 16 17 17 * 33 33 16 18 18 20 20 21 21 * 1 +// LINES(JS_IR): 1 1 1 1 1 1 1 1 * 3 3 9 9 9 4 9 9 * 6 * 31 31 9 6 6 * 7 * 33 33 9 7 7 11 11 12 12 15 15 25 25 26 26 29 29 29 29 29 29 29 29 29 29 29 29 31 31 31 31 33 33 33 33 15 15 * 17 * 31 31 16 17 17 * 18 * 33 33 16 18 18 20 20 21 21 22 22 * 1 diff --git a/js/js.translator/testData/lineNumbers/doWhileWithComplexCondition.kt b/js/js.translator/testData/lineNumbers/doWhileWithComplexCondition.kt index d642f8e133d..dff6ecca68e 100644 --- a/js/js.translator/testData/lineNumbers/doWhileWithComplexCondition.kt +++ b/js/js.translator/testData/lineNumbers/doWhileWithComplexCondition.kt @@ -13,5 +13,5 @@ fun box() { ) } -// LINES(JS): 1 14 8 8 7 3 2 2 3 3 3 8 8 11 11 * 3 7 12 3 3 4 4 -// LINES(JS_IR): 1 2 2 4 4 * 8 8 8 8 8 11 11 * 7 12 +// LINES(JS): 1 14 8 8 7 3 2 2 3 3 3 8 8 11 11 * 3 7 12 3 3 4 4 +// LINES(JS_IR): 1 1 2 2 3 3 4 4 * 8 8 8 8 8 11 11 * 7 12 diff --git a/js/js.translator/testData/lineNumbers/elvis.kt b/js/js.translator/testData/lineNumbers/elvis.kt index 2e326bab1ef..9c8fc7978c0 100644 --- a/js/js.translator/testData/lineNumbers/elvis.kt +++ b/js/js.translator/testData/lineNumbers/elvis.kt @@ -10,4 +10,4 @@ fun box(x: String?) { fun foo() = "bar" // LINES(JS): 3 8 7 7 4 4 4 5 5 7 7 7 7 * 5 4 5 10 10 10 * 1 * 1 -// LINES(JS_IR): 1 1 1 1 1 1 * 3 4 5 5 * 5 * 7 7 7 * 5 4 4 10 10 10 * 1 +// LINES(JS_IR): 1 1 1 1 1 1 1 1 * 3 3 4 5 5 * 5 5 * 7 7 7 * 5 4 4 10 10 10 10 * 1 diff --git a/js/js.translator/testData/lineNumbers/enumCompanionObject.kt b/js/js.translator/testData/lineNumbers/enumCompanionObject.kt index 5210111743d..7e4d2358ef9 100644 --- a/js/js.translator/testData/lineNumbers/enumCompanionObject.kt +++ b/js/js.translator/testData/lineNumbers/enumCompanionObject.kt @@ -6,5 +6,5 @@ enum class Foo { } } -// LINES(JS): 1 1 1 1 1 1 1 1 1 2 2 4 * 2 2 2 2 4 4 5 5 * 4 4 4 4 4 4 4 * 1 1 1 * 1 1 1 1 1 1 -// LINES(JS_IR): 4 * 5 5 5 5 5 * 1 * 1 * 1 +// LINES(JS): 1 1 1 1 1 1 1 1 1 2 2 4 * 2 2 2 2 4 4 5 5 * 4 4 4 4 4 4 4 * 1 1 1 * 1 1 1 1 1 1 +// LINES(JS_IR): 4 4 * 5 5 5 5 5 * 1 * 1 * 1 1 diff --git a/js/js.translator/testData/lineNumbers/enumObject.kt b/js/js.translator/testData/lineNumbers/enumObject.kt index b6fbcfe340c..fefd2a73ca2 100644 --- a/js/js.translator/testData/lineNumbers/enumObject.kt +++ b/js/js.translator/testData/lineNumbers/enumObject.kt @@ -11,4 +11,4 @@ enum class E { } // LINES(JS): 1 1 1 1 1 1 1 1 1 2 2 4 8 * 2 2 2 2 4 4 4 5 5 5 * 4 4 4 4 8 8 8 9 9 9 * 8 8 8 8 * 1 1 1 * 1 1 1 1 1 1 1 1 1 1 -// LINES(JS_IR): 4 * 5 5 5 * 8 * 9 9 9 * 1 * 1 * 1 +// LINES(JS_IR): 4 4 * 5 5 5 * 8 8 * 9 9 9 * 1 * 1 * 1 1 diff --git a/js/js.translator/testData/lineNumbers/expressionAsFunctionBody.kt b/js/js.translator/testData/lineNumbers/expressionAsFunctionBody.kt index 1019a8708f8..c4c14551ede 100644 --- a/js/js.translator/testData/lineNumbers/expressionAsFunctionBody.kt +++ b/js/js.translator/testData/lineNumbers/expressionAsFunctionBody.kt @@ -4,5 +4,5 @@ fun box() = fun foo() = 23 -// LINES(JS): 1 2 2 4 5 5 -// LINES(JS_IR): 1 2 2 4 5 5 +// LINES(JS): 1 2 2 4 5 5 +// LINES(JS_IR): 1 2 2 2 4 5 5 5 diff --git a/js/js.translator/testData/lineNumbers/for.kt b/js/js.translator/testData/lineNumbers/for.kt index aa40421fe08..39653029a2c 100644 --- a/js/js.translator/testData/lineNumbers/for.kt +++ b/js/js.translator/testData/lineNumbers/for.kt @@ -18,4 +18,4 @@ fun box() { } // LINES(JS): 1 18 2 2 10 2 2 2 2 2 2 3 3 6 6 6 6 7 7 10 10 10 10 10 10 11 11 14 14 15 15 15 15 16 16 -// LINES(JS_IR): 1 * 12 2 18 18 35 35 2 2 2 2 2 2 2 2 2 2 2 3 3 6 6 6 6 6 6 6 7 7 6 10 10 10 10 10 11 11 14 14 15 15 15 15 15 15 15 15 15 16 16 15 +// LINES(JS_IR): 1 1 * 2 * 35 * 18 * 12 2 18 18 35 35 2 2 2 2 2 2 2 2 2 2 2 2 3 3 6 6 6 6 6 6 6 6 6 7 7 10 10 10 10 10 10 11 11 14 14 15 15 15 15 15 15 15 15 15 15 15 16 16 diff --git a/js/js.translator/testData/lineNumbers/increment.kt b/js/js.translator/testData/lineNumbers/increment.kt index 58300b392d4..113f83ac399 100644 --- a/js/js.translator/testData/lineNumbers/increment.kt +++ b/js/js.translator/testData/lineNumbers/increment.kt @@ -8,5 +8,5 @@ fun foo(x: Int) { println(y) } -// LINES(JS): 1 9 2 2 3 3 4 4 5 5 6 6 7 7 8 8 -// LINES(JS_IR): 1 2 2 3 3 3 3 4 4 5 5 6 6 7 7 8 8 +// LINES(JS): 1 9 2 2 3 3 4 4 5 5 6 6 7 7 8 8 +// LINES(JS_IR): 1 1 2 2 3 3 3 3 4 4 5 5 6 6 7 7 8 8 diff --git a/js/js.translator/testData/lineNumbers/inlineArguments.kt b/js/js.translator/testData/lineNumbers/inlineArguments.kt index 1a2b4de7e5d..8d3a63efe05 100644 --- a/js/js.translator/testData/lineNumbers/inlineArguments.kt +++ b/js/js.translator/testData/lineNumbers/inlineArguments.kt @@ -12,4 +12,4 @@ inline fun foo(x: Int) { fun bar() = 23 // LINES(JS): 3 5 4 4 8 8 9 9 7 10 8 8 9 9 12 12 12 * 1 * 1 -// LINES(JS_IR): 1 1 1 1 1 1 * 3 * 4 4 8 8 9 9 7 8 8 9 9 12 12 12 * 1 +// LINES(JS_IR): 1 1 1 1 1 1 1 1 * 3 3 4 * 4 4 8 8 9 9 7 7 8 8 9 9 12 12 12 12 * 1 diff --git a/js/js.translator/testData/lineNumbers/inlineLocalVarsRef.kt b/js/js.translator/testData/lineNumbers/inlineLocalVarsRef.kt index e4b066e7f90..9c09fdc3c4f 100644 --- a/js/js.translator/testData/lineNumbers/inlineLocalVarsRef.kt +++ b/js/js.translator/testData/lineNumbers/inlineLocalVarsRef.kt @@ -9,5 +9,5 @@ fun bar() { foo(42) } -// LINES(JS): 1 1 1 1 1 6 2 2 3 3 4 4 8 10 2 2 9 2 3 3 4 4 -// LINES(JS_IR): 1 2 2 3 4 4 8 * 2 2 3 4 4 +// LINES(JS): 1 1 1 1 1 6 2 2 3 3 4 4 8 10 2 2 9 2 3 3 4 4 +// LINES(JS_IR): 1 1 2 2 3 3 3 4 4 8 8 9 * 2 2 3 3 3 4 4 diff --git a/js/js.translator/testData/lineNumbers/inlineMultiModule/simple.kt b/js/js.translator/testData/lineNumbers/inlineMultiModule/simple.kt index 048fff7f98b..280305960ec 100644 --- a/js/js.translator/testData/lineNumbers/inlineMultiModule/simple.kt +++ b/js/js.translator/testData/lineNumbers/inlineMultiModule/simple.kt @@ -9,7 +9,7 @@ inline fun foo(x: String) { } // LINES(JS): 6 6 6 6 6 9 7 7 8 8 -// LINES(JS_IR): 6 7 7 8 8 +// LINES(JS_IR): 6 6 7 7 8 8 // MODULE: main(lib) // FILE: main.kt @@ -22,5 +22,5 @@ fun box() { foo("42") } -// LINES(JS): 6 20 23 7 7 21 7 8 8 21 8 7 7 22 7 8 8 22 8 -// LINES(JS_IR): 20 * 7 7 8 8 * 7 7 8 8 +// LINES(JS): 6 20 23 7 7 21 7 8 8 21 8 7 7 22 7 8 8 22 8 +// LINES(JS_IR): 20 20 21 * 7 7 8 8 22 * 7 7 8 8 diff --git a/js/js.translator/testData/lineNumbers/inlineReturn.kt b/js/js.translator/testData/lineNumbers/inlineReturn.kt index a4a0bce56d4..931ac9b1fa3 100644 --- a/js/js.translator/testData/lineNumbers/inlineReturn.kt +++ b/js/js.translator/testData/lineNumbers/inlineReturn.kt @@ -21,5 +21,5 @@ fun bar(x: Int) { println("%") } -// LINES(JS): 1 1 1 1 1 1 1 1 1 17 2 2 3 3 4 7 7 9 9 10 10 11 14 14 16 16 19 22 20 20 20 20 17 2 2 3 3 4 3 7 7 9 9 10 10 11 10 14 14 16 16 20 21 21 -// LINES(JS_IR): 1 2 3 3 4 7 7 9 10 10 11 14 14 16 16 19 * 20 20 2 3 3 4 * 7 7 9 10 10 11 * 14 14 16 16 20 20 21 21 +// LINES(JS): 1 1 1 1 1 1 1 1 1 17 2 2 3 3 4 7 7 9 9 10 10 11 14 14 16 16 19 22 20 20 20 20 17 2 2 3 3 4 3 7 7 9 9 10 10 11 10 14 14 16 16 20 21 21 +// LINES(JS_IR): 1 1 2 2 2 3 3 4 7 7 9 9 9 10 10 11 14 14 16 16 19 19 * 20 * 20 20 2 2 2 3 3 4 * 7 7 9 9 9 10 10 11 * 14 14 16 16 20 20 21 21 diff --git a/js/js.translator/testData/lineNumbers/inlining.kt b/js/js.translator/testData/lineNumbers/inlining.kt index f303217deb9..f01c9bc8bc7 100644 --- a/js/js.translator/testData/lineNumbers/inlining.kt +++ b/js/js.translator/testData/lineNumbers/inlining.kt @@ -11,5 +11,5 @@ inline fun bar() { println("bar2") } -// LINES(JS): 1 7 2 2 10 10 11 11 4 4 10 10 11 11 6 6 9 9 9 9 9 12 10 10 11 11 -// LINES(JS_IR): 1 2 2 * 10 10 11 11 4 4 * 10 10 11 11 6 6 9 10 10 11 11 +// LINES(JS): 1 7 2 2 10 10 11 11 4 4 10 10 11 11 6 6 9 9 9 9 9 12 10 10 11 11 +// LINES(JS_IR): 1 1 2 2 3 * 10 10 11 11 4 4 5 * 10 10 11 11 6 6 9 9 10 10 11 11 diff --git a/js/js.translator/testData/lineNumbers/inliningWithLambda.kt b/js/js.translator/testData/lineNumbers/inliningWithLambda.kt index 3e0b115fd0b..b6f2cdd1a12 100644 --- a/js/js.translator/testData/lineNumbers/inliningWithLambda.kt +++ b/js/js.translator/testData/lineNumbers/inliningWithLambda.kt @@ -16,5 +16,5 @@ inline fun foo(f: () -> Unit) { println("after") } -// LINES(JS): 1 11 2 2 14 14 4 4 16 16 6 6 14 14 8 8 16 16 10 10 13 13 13 13 13 17 14 14 15 15 16 16 -// LINES(JS_IR): 1 2 2 * 14 14 * 4 4 16 16 6 6 * 14 14 * 8 8 16 16 10 10 13 14 14 15 15 16 16 +// LINES(JS): 1 11 2 2 14 14 4 4 16 16 6 6 14 14 8 8 16 16 10 10 13 13 13 13 13 17 14 14 15 15 16 16 +// LINES(JS_IR): 1 1 2 2 3 * 14 14 15 * 4 4 16 16 6 6 7 * 14 14 15 * 8 8 16 16 10 10 13 13 14 14 15 15 16 16 diff --git a/js/js.translator/testData/lineNumbers/innerClass.kt b/js/js.translator/testData/lineNumbers/innerClass.kt index 2e93ceddfee..5312a36abad 100644 --- a/js/js.translator/testData/lineNumbers/innerClass.kt +++ b/js/js.translator/testData/lineNumbers/innerClass.kt @@ -6,5 +6,5 @@ class A(val x: Int) { } } -// LINES(JS): 1 1 2 2 3 5 4 4 -// LINES(JS_IR): 2 2 2 3 4 4 1 1 1 1 1 1 +// LINES(JS): 1 1 2 2 3 5 4 4 +// LINES(JS_IR): 2 2 2 2 3 4 4 1 1 1 1 1 1 1 diff --git a/js/js.translator/testData/lineNumbers/isOperator.kt b/js/js.translator/testData/lineNumbers/isOperator.kt index 9ed10c503b0..219244f4fc0 100644 --- a/js/js.translator/testData/lineNumbers/isOperator.kt +++ b/js/js.translator/testData/lineNumbers/isOperator.kt @@ -11,5 +11,5 @@ inline fun foo(): Boolean { return true } -// LINES(JS): 3 7 4 4 4 10 10 4 11 4 5 5 9 12 10 10 11 11 * 1 * 1 -// LINES(JS_IR): 1 1 1 1 1 1 * 3 * 4 * 10 10 11 11 4 4 * 5 5 9 10 10 11 11 * 1 +// LINES(JS): 3 7 4 4 4 10 10 4 11 4 5 5 9 12 10 10 11 11 * 1 * 1 +// LINES(JS_IR): 1 1 1 1 1 1 1 1 * 3 3 * 4 * 4 * 10 10 11 11 4 4 * 5 5 9 9 10 10 11 11 * 1 diff --git a/js/js.translator/testData/lineNumbers/jsCode.kt b/js/js.translator/testData/lineNumbers/jsCode.kt index 3ebe9b3a9f9..8929544137d 100644 --- a/js/js.translator/testData/lineNumbers/jsCode.kt +++ b/js/js.translator/testData/lineNumbers/jsCode.kt @@ -5,5 +5,5 @@ fun foo() { println("after: $x") } -// LINES(JS): 1 6 2 2 3 3 4 4 5 5 -// LINES(JS_IR): 1 2 2 3 3 4 4 5 5 +// LINES(JS): 1 6 2 2 3 3 4 4 5 5 +// LINES(JS_IR): 1 1 2 2 3 3 4 4 5 5 diff --git a/js/js.translator/testData/lineNumbers/lambdaWithClosure.kt b/js/js.translator/testData/lineNumbers/lambdaWithClosure.kt index 2d5c4be6a68..22296430170 100644 --- a/js/js.translator/testData/lineNumbers/lambdaWithClosure.kt +++ b/js/js.translator/testData/lineNumbers/lambdaWithClosure.kt @@ -5,4 +5,4 @@ fun foo(x: Int): () -> Unit = { fun bar() = 23 // LINES(JS): 1 1 1 3 2 2 3 3 1 1 1 5 5 5 -// LINES(JS_IR): 1 3 3 1 5 5 5 1 1 2 2 +// LINES(JS_IR): 1 1 3 3 1 5 5 5 5 1 1 1 2 2 3 3 diff --git a/js/js.translator/testData/lineNumbers/lastExpressionInInlineLambda.kt b/js/js.translator/testData/lineNumbers/lastExpressionInInlineLambda.kt index 20a6021a173..7498ba693b3 100644 --- a/js/js.translator/testData/lineNumbers/lastExpressionInInlineLambda.kt +++ b/js/js.translator/testData/lineNumbers/lastExpressionInInlineLambda.kt @@ -24,5 +24,5 @@ fun baz() = "baz" fun boo() = "boo" -// LINES(JS): 1 17 9 4 6 6 7 7 3 3 3 * 13 12 13 13 14 19 21 20 20 23 23 23 25 25 25 -// LINES(JS_IR): 1 * 4 * 7 * 3 20 20 * 12 12 12 13 14 20 20 19 20 20 23 23 23 25 25 25 +// LINES(JS): 1 17 9 4 6 6 7 7 3 3 3 * 13 12 13 13 14 19 21 20 20 23 23 23 25 25 25 +// LINES(JS_IR): 1 1 * 2 * 20 * 4 6 * 7 * 3 20 20 * 11 * 20 * 12 12 12 13 14 20 20 19 19 20 20 23 23 23 23 25 25 25 25 diff --git a/js/js.translator/testData/lineNumbers/literals.kt b/js/js.translator/testData/lineNumbers/literals.kt index 01acd90d623..dc1bd2cde69 100644 --- a/js/js.translator/testData/lineNumbers/literals.kt +++ b/js/js.translator/testData/lineNumbers/literals.kt @@ -26,5 +26,5 @@ fun bar(vararg x: Any?) { println(x) } -// LINES(JS): 1 2 22 3 4 5 6 7 8 9 10 13 14 15 16 17 18 19 20 * 25 27 26 26 -// LINES(JS_IR): 1 2 3 4 5 6 7 8 9 10 13 14 15 16 17 18 19 20 25 26 26 +// LINES(JS): 1 2 22 3 4 5 6 7 8 9 10 13 14 15 16 17 18 19 20 * 25 27 26 26 +// LINES(JS_IR): 1 1 2 3 4 5 6 7 8 9 10 13 14 15 16 17 18 19 20 25 25 26 26 diff --git a/js/js.translator/testData/lineNumbers/longLiteral.kt b/js/js.translator/testData/lineNumbers/longLiteral.kt index fddfec8ef7e..9cc2fea5db2 100644 --- a/js/js.translator/testData/lineNumbers/longLiteral.kt +++ b/js/js.translator/testData/lineNumbers/longLiteral.kt @@ -5,5 +5,5 @@ fun foo() { 0L) } -// LINES(JS): 3 * 5 1 6 2 4 -// LINES(JS_IR): 1 2 4 +// LINES(JS): 3 * 5 1 6 2 4 +// LINES(JS_IR): 1 1 2 4 diff --git a/js/js.translator/testData/lineNumbers/memberFunWithDefaultParam.kt b/js/js.translator/testData/lineNumbers/memberFunWithDefaultParam.kt index c76e2fde793..8f4f73c719c 100644 --- a/js/js.translator/testData/lineNumbers/memberFunWithDefaultParam.kt +++ b/js/js.translator/testData/lineNumbers/memberFunWithDefaultParam.kt @@ -10,5 +10,5 @@ class B : A() { } } -// LINES(JS): 1 2 2 2 2 2 2 2 2 2 4 4 4 * 7 7 8 10 9 9 -// LINES(JS_IR): 1 2 2 2 2 2 2 2 4 4 4 7 7 8 9 9 +// LINES(JS): 1 2 2 2 2 2 2 2 2 2 4 4 4 * 7 7 8 10 9 9 +// LINES(JS_IR): 1 1 2 2 2 2 2 2 2 4 4 4 7 7 7 8 9 9 diff --git a/js/js.translator/testData/lineNumbers/multipleReferences.kt b/js/js.translator/testData/lineNumbers/multipleReferences.kt index 4abfa63b33a..5edcf30acff 100644 --- a/js/js.translator/testData/lineNumbers/multipleReferences.kt +++ b/js/js.translator/testData/lineNumbers/multipleReferences.kt @@ -12,5 +12,5 @@ object O { val y = 23 } -// LINES(JS): 1 9 2 2 3 3 4 4 6 6 7 7 8 8 11 11 12 12 * 11 11 11 11 11 11 -// LINES(JS_IR): 1 2 2 3 3 4 4 6 6 7 7 8 8 11 * 12 12 12 12 12 +// LINES(JS): 1 9 2 2 3 3 4 4 6 6 7 7 8 8 11 11 12 12 * 11 11 11 11 11 11 +// LINES(JS_IR): 1 1 2 2 3 3 4 4 6 6 7 7 8 8 11 11 * 12 12 12 12 12 diff --git a/js/js.translator/testData/lineNumbers/objectInstanceFunction.kt b/js/js.translator/testData/lineNumbers/objectInstanceFunction.kt index 850cfbeabd8..19e9f410297 100644 --- a/js/js.translator/testData/lineNumbers/objectInstanceFunction.kt +++ b/js/js.translator/testData/lineNumbers/objectInstanceFunction.kt @@ -4,5 +4,5 @@ fun foo() { println("foo") } -// LINES(JS): 1 1 * 1 1 1 1 1 1 3 5 4 4 -// LINES(JS_IR): 1 * 3 4 4 +// LINES(JS): 1 1 * 1 1 1 1 1 1 3 5 4 4 +// LINES(JS_IR): 1 1 * 3 3 4 4 diff --git a/js/js.translator/testData/lineNumbers/propertyWithoutInitializer.kt b/js/js.translator/testData/lineNumbers/propertyWithoutInitializer.kt index 5d967dd0a0b..3a2be9c76cd 100644 --- a/js/js.translator/testData/lineNumbers/propertyWithoutInitializer.kt +++ b/js/js.translator/testData/lineNumbers/propertyWithoutInitializer.kt @@ -9,5 +9,5 @@ open class A { } } -// LINES(JS): 1 2 4 7 7 8 8 4 4 4 -// LINES(JS_IR): 1 7 7 8 8 2 2 2 4 4 4 +// LINES(JS): 1 2 4 7 7 8 8 4 4 4 +// LINES(JS_IR): 1 1 7 7 8 8 2 2 2 4 4 4 diff --git a/js/js.translator/testData/lineNumbers/simple.kt b/js/js.translator/testData/lineNumbers/simple.kt index 64f870d8f50..069e71dfb89 100644 --- a/js/js.translator/testData/lineNumbers/simple.kt +++ b/js/js.translator/testData/lineNumbers/simple.kt @@ -3,5 +3,5 @@ fun box() { println("bar") } -// LINES(JS): 1 4 2 2 3 3 -// LINES(JS_IR): 1 2 2 3 3 +// LINES(JS): 1 4 2 2 3 3 +// LINES(JS_IR): 1 1 2 2 3 3 diff --git a/js/js.translator/testData/lineNumbers/stringLiteral.kt b/js/js.translator/testData/lineNumbers/stringLiteral.kt index 52376927cb3..2e1e9496f72 100644 --- a/js/js.translator/testData/lineNumbers/stringLiteral.kt +++ b/js/js.translator/testData/lineNumbers/stringLiteral.kt @@ -4,5 +4,5 @@ fun box(x: Int): String { "suffix" } -// LINES(JS): 1 5 2 2 3 4 -// LINES(JS_IR): 1 2 2 3 4 +// LINES(JS): 1 5 2 2 3 4 +// LINES(JS_IR): 1 1 2 2 3 4 diff --git a/js/js.translator/testData/lineNumbers/syntheticCodeInConstructors.kt b/js/js.translator/testData/lineNumbers/syntheticCodeInConstructors.kt index 1bc13654118..be73c86e334 100644 --- a/js/js.translator/testData/lineNumbers/syntheticCodeInConstructors.kt +++ b/js/js.translator/testData/lineNumbers/syntheticCodeInConstructors.kt @@ -25,5 +25,5 @@ class C : A { ) } -// LINES(JS): 1 1 3 * 1 1 1 1 1 1 7 * 9 10 11 * 15 15 16 17 14 19 15 15 22 22 23 24 22 22 -// LINES(JS_IR): 1 * 3 * 7 9 10 11 16 17 15 19 * 23 24 23 +// LINES(JS): 1 1 3 * 1 1 1 1 1 1 7 * 9 10 11 * 15 15 16 17 14 19 15 15 22 22 23 24 22 22 +// LINES(JS_IR): 1 1 * 3 * 7 7 9 9 10 11 16 17 15 19 * 23 24 23 * 14 diff --git a/js/js.translator/testData/lineNumbers/syntheticCodeInEnums.kt b/js/js.translator/testData/lineNumbers/syntheticCodeInEnums.kt index 46afba8f84b..9c766f570b3 100644 --- a/js/js.translator/testData/lineNumbers/syntheticCodeInEnums.kt +++ b/js/js.translator/testData/lineNumbers/syntheticCodeInEnums.kt @@ -9,4 +9,4 @@ enum class E { } // LINES(JS): 1 1 1 1 1 1 1 1 1 2 2 3 3 4 * 2 2 2 2 * 3 3 3 3 4 4 4 6 6 * 4 4 4 4 * 1 1 1 * 1 1 1 1 1 1 1 1 1 1 -// LINES(JS_IR): 4 * 6 6 * 1 * 1 * 1 +// LINES(JS_IR): 4 4 * 6 6 * 1 * 1 * 1 1 diff --git a/js/js.translator/testData/lineNumbers/valParameter.kt b/js/js.translator/testData/lineNumbers/valParameter.kt index b5d359c04ee..aef6f01201f 100644 --- a/js/js.translator/testData/lineNumbers/valParameter.kt +++ b/js/js.translator/testData/lineNumbers/valParameter.kt @@ -7,5 +7,5 @@ fun foo() { A(23, "foo") } -// LINES(JS): 1 2 3 * 6 8 7 7 -// LINES(JS_IR): 1 2 2 3 3 2 2 2 3 3 3 6 7 7 +// LINES(JS): 1 2 3 * 6 8 7 7 +// LINES(JS_IR): 1 1 2 2 3 3 2 2 2 3 3 3 6 6 7 7 diff --git a/js/js.translator/testData/lineNumbers/whenEntryWithMultipleConditions.kt b/js/js.translator/testData/lineNumbers/whenEntryWithMultipleConditions.kt index d2d47307cda..30b41dff00a 100644 --- a/js/js.translator/testData/lineNumbers/whenEntryWithMultipleConditions.kt +++ b/js/js.translator/testData/lineNumbers/whenEntryWithMultipleConditions.kt @@ -19,4 +19,4 @@ fun box(x: Int) { } // LINES(JS): 1 19 4 4 3 3 4 6 9 9 6 11 13 13 11 16 16 3 2 -// LINES(JS_IR): 1 4 4 2 6 7 8 9 11 12 13 16 +// LINES(JS_IR): 1 1 4 4 2 8 7 6 7 8 9 12 11 12 13 16 diff --git a/js/js.translator/testData/lineNumbers/whenEntryWithMultipleConditionsNonOptimized.kt b/js/js.translator/testData/lineNumbers/whenEntryWithMultipleConditionsNonOptimized.kt index fd83f6bd0d5..be8e9faa4d7 100644 --- a/js/js.translator/testData/lineNumbers/whenEntryWithMultipleConditionsNonOptimized.kt +++ b/js/js.translator/testData/lineNumbers/whenEntryWithMultipleConditionsNonOptimized.kt @@ -29,4 +29,4 @@ fun four() = 4 fun five() = 5 // LINES(JS): 1 19 4 4 3 6 4 6 4 7 4 8 9 9 11 4 11 4 12 13 13 16 16 2 21 21 21 23 23 23 25 25 25 27 27 27 29 29 29 -// LINES(JS_IR): 1 4 4 2 6 7 8 9 11 12 13 16 21 21 21 23 23 23 25 25 25 27 27 27 29 29 29 +// LINES(JS_IR): 1 1 4 4 2 8 7 6 7 8 9 12 11 12 13 16 21 21 21 21 23 23 23 23 25 25 25 25 27 27 27 27 29 29 29 29 diff --git a/js/js.translator/testData/lineNumbers/whenIn.kt b/js/js.translator/testData/lineNumbers/whenIn.kt index b263e646f10..e84e95e32c7 100644 --- a/js/js.translator/testData/lineNumbers/whenIn.kt +++ b/js/js.translator/testData/lineNumbers/whenIn.kt @@ -13,5 +13,5 @@ fun foo(): Int = 23 fun bar(): IntRange = 1000..2000 -// LINES(JS): 1 10 2 2 2 2 3 3 4 4 5 5 6 6 7 7 8 8 12 12 12 14 14 14 -// LINES(JS_IR): 1 2 2 3 4 4 5 6 6 7 7 7 7 7 8 8 12 12 12 14 14 14 +// LINES(JS): 1 10 2 2 2 2 3 3 4 4 5 5 6 6 7 7 8 8 12 12 12 14 14 14 +// LINES(JS_IR): 1 1 2 2 3 3 4 4 5 5 6 6 7 7 7 7 7 7 8 8 12 12 12 12 14 14 14 14 diff --git a/js/js.translator/testData/lineNumbers/whenIs.kt b/js/js.translator/testData/lineNumbers/whenIs.kt index 0fda1c71920..fe3412e6710 100644 --- a/js/js.translator/testData/lineNumbers/whenIs.kt +++ b/js/js.translator/testData/lineNumbers/whenIs.kt @@ -13,5 +13,5 @@ open class A open class B : A() -// LINES(JS): 1 10 2 2 2 2 3 3 4 4 5 5 6 6 8 8 12 * 14 14 -// LINES(JS_IR): 1 2 2 3 4 4 5 6 6 8 8 12 14 14 +// LINES(JS): 1 10 2 2 2 2 3 3 4 4 5 5 6 6 8 8 12 * 14 14 +// LINES(JS_IR): 1 1 2 2 3 4 4 5 6 6 8 8 12 12 14 14 14 diff --git a/js/js.translator/testData/lineNumbers/whileWithComplexCondition.kt b/js/js.translator/testData/lineNumbers/whileWithComplexCondition.kt index e63f3d3b9fd..232fab9997a 100644 --- a/js/js.translator/testData/lineNumbers/whileWithComplexCondition.kt +++ b/js/js.translator/testData/lineNumbers/whileWithComplexCondition.kt @@ -12,5 +12,5 @@ fun box() { } } -// LINES(JS): 1 13 5 5 4 2 2 3 5 5 8 8 * 3 4 9 3 11 11 -// LINES(JS_IR): 1 2 2 * 5 5 5 5 5 8 8 * 4 9 * 11 11 +// LINES(JS): 1 13 5 5 4 2 2 3 5 5 8 8 * 3 4 9 3 11 11 +// LINES(JS_IR): 1 1 2 2 * 3 * 5 5 5 5 5 8 8 * 4 9 * 11 11