unary-new: built parser and new => now works

This commit is contained in:
satyr
2010-09-27 02:11:47 +09:00
parent db531495b8
commit e188b9ff41
6 changed files with 127 additions and 130 deletions

View File

@@ -947,7 +947,7 @@ exports.CodeNode = class CodeNode extends BaseNode
(o.scope.parameter(param)) for param in params
code = if @body.expressions.length then "\n#{ @body.compileWithDeclarations(o) }\n" else ''
func = "function(#{ params.join(', ') }) {#{code}#{ code and @tab }}"
return "#{utility('bind')}(#{func}, #{@context})" if @bound
return "(#{utility 'bind'}(#{func}, #{@context}))" if @bound
if top then "(#{func})" else func
topSensitive: ->