Allow to embed source files into JS source maps

This commit is contained in:
Alexey Andreev
2017-06-14 14:03:37 +03:00
parent 73c37ecd25
commit a0e1bde594
40 changed files with 491 additions and 81 deletions
@@ -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