Skip to content

Commit 3d057f8

Browse files
committed
Emissions output: replace unicode "_", add trailing line
1 parent 9f484dc commit 3d057f8

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

library/testEmissions/jvm/src/test/resources/sjr/UseState-out2.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ function $c_Lsjr_test_emissions_UseState$() {
1010
$j_java_lang_Object.$as_jl_Void(x$1$2);
1111
var s = $j_sjr_hooks_Hooks$UseStateF.$as_Lsjr_hooks_Hooks$UseStateF(s$2);
1212
var $$x2 = $j_sjr_vdom_HtmlTagOf$.$m_Lsjr_vdom_HtmlTagOf$();
13-
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
13+
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
1414
$j_sjr_vdom_Exports$.$m_Lsjr_vdom_Exports$();
15-
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
15+
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
1616
$j_sjr_vdom_VdomNode$.$m_Lsjr_vdom_VdomNode$();
1717
var $$x1 = new $j_sjr_vdom_VdomNode$$anon$1.$c_Lsjr_vdom_VdomNode$$anon$1("Count is ");
18-
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
18+
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
1919
var v = $j_java_lang_Object.$uI(s.Lsjr_hooks_Hooks$UseStateF$$anon$2__f_raw[0]);
2020
$j_sjr_vdom_VdomNode$.$m_Lsjr_vdom_VdomNode$();
21-
var array = [$$x1, new $j_sjr_vdom_VdomNode$$anon$1.$c_Lsjr_vdom_VdomNode$$anon$1(v), $j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$().Lsjr_vdom_html_$__f_$up.Lsjr_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Lsjr_vdom_TagMod(new $j_AnonFunction0.$c_sjsr_AnonFunction0((s$1 => () => {
21+
var array = [$$x1, new $j_sjr_vdom_VdomNode$$anon$1.$c_Lsjr_vdom_VdomNode$$anon$1(v), $j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$().Lsjr_vdom_html_$__f_$up.Lsjr_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Lsjr_vdom_TagMod(new $j_AnonFunction0.$c_sjsr_AnonFunction0((s$1 => () => {
2222
$j_sjr_Reusable$.$m_Lsjr_Reusable$();
2323
var r = $j_sjr_hooks_Hooks$UseStateF.$f_Lsjr_hooks_Hooks$UseStateF__modState__Lsjr_Reusable(s$1);
2424
return new $j_sjr_callback_CallbackTo.$c_Lsjr_callback_CallbackTo($j_sjr_callback_CallbackTo.$as_Lsjr_callback_CallbackTo($j_scala_Function1.$as_F1(r.value__O()).apply__O__O(new $j_scala_Function1.$c_sjsr_AnonFunction1(x$2$2 => {
@@ -29,9 +29,9 @@ function $c_Lsjr_test_emissions_UseState$() {
2929
return $$x2.apply$extension__T__sci_Seq__Lsjr_vdom_TagOf("button", new $j_WrappedVarArgs.$c_sjsr_WrappedVarArgs(array));
3030
});
3131
var this$17 = $j_sjr_hooks_HookComponentBuilder$ComponentP$SubsequentStep$.$m_Lsjr_hooks_HookComponentBuilder$ComponentP$SubsequentStep$();
32-
var step$1 = new $j_sjr_hooks_ComponentP_SubsequentSteps$$anon$1.$c_Lsjr_hooks_ComponentP_SubsequentSteps$$anon$1(this$17);
32+
var step$1 = new $j_sjr_hooks_ComponentP_SubsequentSteps$$anon$1.$c_Lsjr_hooks_ComponentP_SubsequentSteps$$anon$1(this$17);
3333
var s$3 = $j_sjr_CtorType$Summoner$.$m_Lsjr_CtorType$Summoner$().summonN__Lsjr_internal_Singleton__Lsjr_CtorType$Summoner($j_sjr_internal_Singleton$.$m_Lsjr_internal_Singleton$().Lsjr_internal_Singleton$__f_BoxUnit);
3434
this.Lsjr_test_emissions_UseState$__f_Component = $j_sjr_hooks_Api$SecondaryWithRender.$f_Lsjr_hooks_Api$SecondaryWithRender__render__O__Lsjr_hooks_Api$SubsequentStep__Lsjr_CtorType$Summoner__Lsjr_component_JsBaseComponentTemplate$ComponentWithRoot(this$18, f, step$1, s$3);
3535
}
3636

37-
export { $c_Lsjr_test_emissions_UseState$ };
37+
export { $c_Lsjr_test_emissions_UseState$ };

library/testEmissions/jvm/src/test/resources/sjr/UseState-out3.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ function $c_Lsjr_test_emissions_UseState$() {
1010
$j_java_lang_Object.$as_jl_Void(_$1);
1111
var s$1 = $j_sjr_hooks_Hooks$UseStateF.$as_Lsjr_hooks_Hooks$UseStateF(s);
1212
var this$14 = $j_sjr_vdom_HtmlTagOf$.$m_Lsjr_vdom_HtmlTagOf$();
13-
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
13+
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
1414
$j_sjr_vdom_Exports$.$m_Lsjr_vdom_Exports$();
1515
var self = "button";
1616
var $$x2 = $j_java_lang_Character$.$m_sr_ScalaRunTime$();
17-
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
17+
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
1818
$j_sjr_vdom_VdomNode$.$m_Lsjr_vdom_VdomNode$();
1919
var $$x1 = new $j_sjr_vdom_VdomNode$$anon$1.$c_Lsjr_vdom_VdomNode$$anon$1("Count is ");
20-
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
20+
$j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$();
2121
var v = $j_java_lang_Object.$uI(s$1.Lsjr_hooks_Hooks$$anon$2__f_raw[0]);
2222
$j_sjr_vdom_VdomNode$.$m_Lsjr_vdom_VdomNode$();
23-
var xs = $$x2.wrapRefArray__AO__sci_ArraySeq(new ($j_sjr_vdom_TagMod.$d_Lsjr_vdom_TagMod.getArrayOf().constr)([$$x1, new $j_sjr_vdom_VdomNode$$anon$1.$c_Lsjr_vdom_VdomNode$$anon$1(v), $j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$().Lsjr_vdom_html_$__f_$up.Lsjr_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Lsjr_vdom_TagMod(new $j_AnonFunction0.$c_sjsr_AnonFunction0((s$2 => () => {
23+
var xs = $$x2.wrapRefArray__AO__sci_ArraySeq(new ($j_sjr_vdom_TagMod.$d_Lsjr_vdom_TagMod.getArrayOf().constr)([$$x1, new $j_sjr_vdom_VdomNode$$anon$1.$c_Lsjr_vdom_VdomNode$$anon$1(v), $j_sjr_vdom_html_$.$m_Lsjr_vdom_html_$().Lsjr_vdom_html_$__f_$up.Lsjr_vdom_HtmlAttrAndStyles$__f_onClick.$minus$minus$greater__F0__F1__Lsjr_vdom_TagMod(new $j_AnonFunction0.$c_sjsr_AnonFunction0((s$2 => () => {
2424
$j_sjr_Reusable$.$m_Lsjr_Reusable$();
2525
var r = $j_sjr_hooks_Hooks$UseStateF.$f_Lsjr_hooks_Hooks$UseStateF__modState__Lsjr_Reusable(s$2);
2626
var ev$1 = $j_scala_Function1.$as_F1(r.value__O()).apply__O__O(new $j_scala_Function1.$c_sjsr_AnonFunction1(_$2 => {
@@ -32,9 +32,9 @@ function $c_Lsjr_test_emissions_UseState$() {
3232
})(s$1)), $j_sjr_vdom_Attr$EventCallback$.$m_Lsjr_vdom_Attr$EventCallback$().Lsjr_vdom_Attr$EventCallback$__f_defaultSync)]));
3333
return $j_sjr_vdom_TagLite.$f_Lsjr_vdom_TagLite__apply__T__sci_Seq__Lsjr_vdom_TagOf(this$14, self, xs);
3434
});
35-
var step$1 = new $j_sjr_hooks_ComponentP_SubsequentSteps$$anon$1.$c_Lsjr_hooks_ComponentP_SubsequentSteps$$anon$1();
35+
var step$1 = new $j_sjr_hooks_ComponentP_SubsequentSteps$$anon$1.$c_Lsjr_hooks_ComponentP_SubsequentSteps$$anon$1();
3636
var s$3 = $j_sjr_CtorType$Summoner$.$m_Lsjr_CtorType$Summoner$().summonN__Lsjr_internal_Singleton__Lsjr_CtorType$Summoner($j_sjr_internal_Singleton$.$m_Lsjr_internal_Singleton$().Lsjr_internal_Singleton$__f_BoxUnit);
3737
this.Lsjr_test_emissions_UseState$__f_Component = $j_sjr_hooks_Api$SecondaryWithRender.$f_Lsjr_hooks_Api$SecondaryWithRender__render__O__Lsjr_hooks_Api$SubsequentStep__Lsjr_CtorType$Summoner__Lsjr_component_JsBaseComponentTemplate$ComponentWithRoot(this$16, f, step$1, s$3);
3838
}
3939

40-
export { $c_Lsjr_test_emissions_UseState$ };
40+
export { $c_Lsjr_test_emissions_UseState$ };

library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/EmissionTest.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ object EmissionTest extends TestSuite {
4646
// Make output much more readable, we're not testing the validity of SJS here
4747
if (normalise)
4848
js.modifyLines(_
49+
.replace("_", "_")
4950
.replace("$0024", "$")
5051
.replace("$002e", "_") // "."
5152
.replace("$005f", "_")

library/testEmissions/jvm/src/test/scala/japgolly/scalajs/react/test/emissions/util/MutableVirtualFile.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class MutableVirtualFile(val filenameOption: Option[String], val originalContent
2525
modifyLinesIterator(_.map(f))
2626

2727
def modifyLinesIterator(f: Iterator[String] => Iterator[String]): this.type =
28-
set(f(content.linesIterator).mkString("\n"))
28+
set(f(content.linesIterator).mkString("\n") + "\n")
2929

3030
def +=(newLine: String): this.type =
3131
set(content + "\n" + newLine)

0 commit comments

Comments
 (0)