Fix JS source maps for return statement of inlined function
This commit is contained in:
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2015 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -27,7 +27,7 @@ class LabelNameRefreshingVisitor(val functionScope: JsFunctionScope) : JsVisitor
|
||||
override fun endVisit(x: JsBreak, ctx: JsContext<JsNode>) {
|
||||
val label = x.label?.name
|
||||
if (label != null) {
|
||||
ctx.replaceMe(JsBreak(getSubstitution(label).makeRef()))
|
||||
ctx.replaceMe(JsBreak(getSubstitution(label).makeRef()).source(x.source))
|
||||
}
|
||||
super.endVisit(x, ctx)
|
||||
}
|
||||
@@ -35,7 +35,7 @@ class LabelNameRefreshingVisitor(val functionScope: JsFunctionScope) : JsVisitor
|
||||
override fun endVisit(x: JsContinue, ctx: JsContext<JsNode>) {
|
||||
val label = x.label?.name
|
||||
if (label != null) {
|
||||
ctx.replaceMe(JsContinue(getSubstitution(label).makeRef()))
|
||||
ctx.replaceMe(JsContinue(getSubstitution(label).makeRef()).source(x.source))
|
||||
}
|
||||
super.endVisit(x, ctx)
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2016 JetBrains s.r.o.
|
||||
* Copyright 2010-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -49,11 +49,11 @@ class ReturnReplacingVisitor(
|
||||
if (returnExpression != null && returnExpression.isTailCallSuspend) {
|
||||
returnReplacement.isSuspend = true
|
||||
}
|
||||
ctx.addNext(JsExpressionStatement(returnReplacement))
|
||||
ctx.addNext(JsExpressionStatement(returnReplacement.apply { source = x.source }))
|
||||
}
|
||||
|
||||
if (breakLabel != null) {
|
||||
ctx.addNext(JsBreak(breakLabel))
|
||||
ctx.addNext(JsBreak(breakLabel).apply { source = x.source })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user