class: RegressionTests::CompilerTests2
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 22 Aug 2013 21:43:34 +0200
changeset 991 c855ef9d606c
parent 990 4ee55eedd9aa
child 992 4acfe6220c73
class: RegressionTests::CompilerTests2 added: #method_argAndVarNames_05 #test_argAndVarNames_05
RegressionTests__CompilerTests2.st
--- a/RegressionTests__CompilerTests2.st	Thu Aug 22 14:03:53 2013 +0200
+++ b/RegressionTests__CompilerTests2.st	Thu Aug 22 21:43:34 2013 +0200
@@ -138,6 +138,31 @@
     "Created: / 20-08-2013 / 10:11:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
+method_argAndVarNames_05
+    | b |
+
+    b := [:len |
+        1 to: len do:[:i|
+            | local1 local2 |
+
+            local1 := #local1.
+            local2 := 42.
+
+            i == 1 ifTrue:[
+                argAndVarNames := thisContext argAndVarNames asArray.
+            ]
+        ]
+    ].
+
+    b value: 5
+
+    "
+    CompilerTests2 basicNew method_argAndVarNames_05
+    "
+
+    "Created: / 22-08-2013 / 15:48:57 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 method_lineno_002
     1 factorial. ^self currentLineNumber
 
@@ -685,6 +710,18 @@
     ]
 
     "Created: / 20-08-2013 / 10:12:08 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+test_argAndVarNames_05
+
+    #(bc jit stc) do:[:mode |
+        argAndVarNames := nil.
+        self compile: (self class >> #method_argAndVarNames_05) source mode: mode.
+        self perform: (mode , '_method_argAndVarNames_05') asSymbol.
+        self assert: argAndVarNames = #(len i local1 local2)
+    ]
+
+    "Created: / 22-08-2013 / 15:49:21 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
 !CompilerTests2 methodsFor:'tests - line numbers'!