File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -1463,6 +1463,7 @@ class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {
1463
1463
1464
1464
my @ pre ;
1465
1465
{
1466
+ my $ * IN_PRE_SERIALIZE := 1 ;
1466
1467
# We create this context so that dependencies are loaded relative to this file
1467
1468
my $ * CTX := ' ctxWithPath' ;
1468
1469
@ pre . push (
@@ -1619,6 +1620,11 @@ class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {
1619
1620
my str $ handle := nqp ::scgethandle($ sc );
1620
1621
my int $ idx := nqp ::scgetobjidx($ sc , $ value );
1621
1622
1623
+ if $ * IN_PRE_SERIALIZE {
1624
+ # We can't setup all the wvals yet
1625
+ return " nqp.wval({ quote_string($ handle )} ,$ idx )" ;
1626
+ }
1627
+
1622
1628
my $ key := $ handle ~ " @" ~ $ idx ;
1623
1629
1624
1630
if ! nqp ::existskey(% ! wval , $ key ) {
@@ -1974,6 +1980,9 @@ class QAST::CompilerJS does DWIMYNameMangling does SerializeOnce {
1974
1980
method as_js_with_prelude ($ ast , : $ instant , : $ shebang ) {
1975
1981
my $ * INSTANT := $ instant ;
1976
1982
1983
+ # We handle wval in the pre-serialization code specially.
1984
+ my $ * IN_PRE_SERIALIZE := 0 ;
1985
+
1977
1986
# Blocks we've seen while compiling.
1978
1987
my % * BLOCKS_DONE ;
1979
1988
my % * BLOCKS_INFO ;
You can’t perform that action at this time.
0 commit comments