     return "#{name}: #{val}" if @context is 'object'
     unless @variable.isAssignable()
       throw SyntaxError "\"#{ @variable.compile o }\" cannot be assigned."
-    o.scope.find name unless @context or
-      isValue and (@variable.namespaced or @variable.hasProperties())
+    unless @context or isValue and (@variable.namespaced or @variable.hasProperties())
+      if @param
+        o.scope.add name, 'var'
+      else
+        o.scope.find name
     val = name + " #{ @context or '=' } " + val
     if o.level <= LEVEL_LIST then val else "(#{val})"
 

# The **Assign** is used to assign a local variable to value, or to set the
# property of an object -- including within object literals.
exports.Assign = class Assign extends Base
  constructor: (@variable, @value, @context) ->

  # Matchers for detecting class/method names
  METHOD_DEF: /^(?:(\S+)\.prototype\.|\S+?)?\b([$A-Za-z_][$\w]*)$/

      if param.isComplex()
        val = ref = param.asReference o
        val = new Op '?', ref, param.value if param.value
        exprs.push new Assign new Value(param.name), val, '=', param: yes
      else
        ref = param
        if param.value
