summaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-05-04 16:32:32 +0200
committerJo-Philipp Wich <jo@mein.io>2021-05-04 16:32:32 +0200
commit16604331c185d7597b53709cc09a072a2652415e (patch)
tree175777b9c4ac0ee49fd1b9de01527e3063d26d91 /tests
parent799c9f4dbe123536e1dde1639a122f48dcf75a05 (diff)
compiler: fix stack mismatch on compiling `use strict` statements
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/custom/03_bugs/20_use_strict_stack_mismatch17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/custom/03_bugs/20_use_strict_stack_mismatch b/tests/custom/03_bugs/20_use_strict_stack_mismatch
new file mode 100644
index 0000000..7294d23
--- /dev/null
+++ b/tests/custom/03_bugs/20_use_strict_stack_mismatch
@@ -0,0 +1,17 @@
+When compiling the `use strict` statement, the compiler omitted the
+corresponding load instruction, leading to a mismatch of the expected
+stack layout between compiler and VM.
+
+-- Expect stdout --
+1
+-- End --
+
+-- Testcase --
+{%
+ "use strict";
+
+ let x = 1;
+
+ print(x, "\n");
+%}
+-- End --