| 222 | this.delegate = delegate |
| 223 | } |
| 224 | } |
| 225 | |
| 226 | companion object { |
| 227 | val output = Dict.Prop<FunctionOfBoxValued<TemplateMap<Browser>>>("output")//.type<Any>() |
| 228 | .doc<FunctionOfBoxValued<TemplateMap<Browser>>>("`_.output.blah.print('something')` will print to (and, if necessary, create) an html output box") |
| 229 | .toCanon<FunctionOfBoxValued<TemplateMap<Browser>>>() |
| 230 | |
| 231 | private fun readFile(s: String, append: Boolean): String { |
| 232 | try { |
| 233 | BufferedReader(FileReader(File(s))).use { r -> |
| 234 | var line = "" |
| 235 | while (r.ready()) { |
| 236 | line += """ |
| 237 | ${r.readLine()} |
| 238 | |
| 239 | """.trimIndent() |
| 240 | } |
| 241 | if (append) line += "\n//# sourceURL=$s" |
| 242 | return line |
| 243 | } |
| 244 | } catch (e: IOException) { |
no test coverage detected