title: Bug in calling self function?
body: <p>I wrote this code:</p>
  
  <pre><code>Editor = {
    x = 10,
    y = 10,
    interpreter = nil,
    cursor = nil
  }
  
  -- Some code here
  
  function Editor:drawValues(w, h)
    for x = 0, w - 1 do
      for y = 0, h - 1 do
        local _x = self.x + x * CELL_SIZE
        local _y = self.y + y * CELL_SIZE
        love.graphics.print(self.interpreter.grid.cell[x][y], _x, _y) -- ERROR THIS!
      end
    end
  end
  
  function Editor:draw()
    local w = self.interpreter.grid.width
    local h = self.interpreter.grid.height
  
    Editor:drawGrid(w, h)
    Editor:drawValues(w, h)
  
    -- Its Works VVVVVVV
    -- for x = 0, w - 1 do
    --   for y = 0, h - 1 do
    --     local _x = self.x + x * CELL_SIZE
    --     local _y = self.y + y * CELL_SIZE
    --     local value = self.interpreter.grid.cell[x][y]
    --     love.graphics.print(value, _x, _y) -- self.interpreter.grid.cell[x][y]
    --   end
    -- end
  end
  
  return Editor
  </code></pre>
  
  <p>Function <code>Editor:draw</code> calls <code>Editor:drawGrid</code> and it works, but calling <code>Editor:drawValues(w, h)</code> throws an error:</p>
  
  <blockquote>
    <p>attempt to index field 'interpreter' (a nil value)</p>
  </blockquote>
  
  <p>But! If I comment <code>Editor:drawValues(w, h)</code> and uncomment the code below, it works. Why?</p>
  
  <p>Apologies for my English.</p>