               if match.constructor == RegExp
                 if result = name.match(match)
                   result.shift()
-                  runCode(code, isLast, result.concat(args))
+                  runCode(code, index, result.concat(args))
                   found = true
 
                   break
               else
                 if name == match
-                  runCode(code, isLast)
+                  runCode(code, index)
                   found = true
 
                   break


              param.apply(_this, args)

          args = []

          if param?
            if typeof param == "function"
              runCode(param, isLast)
              continue
            else
              args = [ param ]

      describe scenarioName, ->
        _this.spies_ = []

        for index in [ 0..._statements.length ]
          [ type, name, param ] = _statements[index]

          _this._type = type
          _this._name = name

          runCode = (param, index, args = []) ->
            isLast = (index + 1) == _statements.length
            isFirst = (index == 0)

            it "#{type} #{name}", ->
              if isFirst
                jasmine.GWT.runHook('Before', _this)

              this.spyOn = (args...) ->
                this.spies_ = _this.spies_
                jasmine.Spec.prototype.spyOn.apply(this, args)
