Allow to embed source files into JS source maps
This commit is contained in:
@@ -16,8 +16,31 @@
|
||||
|
||||
package org.jetbrains.kotlin.js.backend.ast
|
||||
|
||||
import java.io.Reader
|
||||
|
||||
data class JsLocation(
|
||||
val file: String,
|
||||
val startLine: Int,
|
||||
val startChar: Int
|
||||
)
|
||||
override val file: String,
|
||||
override val startLine: Int,
|
||||
override val startChar: Int
|
||||
) : JsLocationWithSource {
|
||||
override val identityObject: Any? = null
|
||||
override val sourceProvider: () -> Reader? = { null }
|
||||
|
||||
override fun asSimpleLocation(): JsLocation = this
|
||||
}
|
||||
|
||||
interface JsLocationWithSource {
|
||||
val file: String
|
||||
val startLine: Int
|
||||
val startChar: Int
|
||||
val identityObject: Any?
|
||||
val sourceProvider: () -> Reader?
|
||||
|
||||
fun asSimpleLocation(): JsLocation
|
||||
}
|
||||
|
||||
class JsLocationWithEmbeddedSource(
|
||||
private val location: JsLocation,
|
||||
override val identityObject: Any?,
|
||||
override val sourceProvider: () -> Reader?
|
||||
) : JsLocationWithSource by location
|
||||
Reference in New Issue
Block a user