   
   page: (selector, values) ->    
     {selector, values} = @_selectorAndValues(selector, values)
-    @addLine("@page #{selector} #{@object_to_css(values)}") if selector
+    # values = if values then values else ''
+    values = @object_to_css(values) if values
+    @addLine("@page #{selector} #{values}") if selector
 
   _selectorAndValues: (selector,values) ->
-    if typeof selector is 'Object'
+    if typeof selector is 'object'
       { selector: '', values: selector }
     else
       selector ?= ''

throw 'CoffeeScript is needed' unless CoffeeScript?

class DocumentStyle


  processStyleText: ->
    styletext = @styletext
    lines = styletext.split('\n')
    lastSelectorLine = null
    for line, i in lines
      lineBeginsWithAttribute = @doesLineBeginsWithAttribute(line)
      line = @renameHyphenFunctionName(line)
      lineBefore = lines[lastSelectorLine]
      # media queries have an exception rule
      if @pattern.isCSSQuery.test(line)
        # @media
