diff --git a/src/nodes.coffee b/src/nodes.coffee index 522a19fd..13f583aa 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -598,7 +598,7 @@ exports.Access = class Access extends Base compile: (o) -> name = @name.compile o - @proto + if IS_STRING.test name then "[#{name}]" else ".#{name}" + @proto + if IDENTIFIER.test name then ".#{name}" else "[#{name}]" isComplex: NO @@ -932,6 +932,7 @@ exports.Assign = class Assign extends Base o.scope.add name, 'var' else o.scope.find name + console.log @variable.constructor.name, name if @value instanceof Code and match = METHOD_DEF.exec name @value.klass = match[1] if match[1] @value.name = match[2] ? match[3] ? match[4]