lib/minjs/ecma262/st.rb in minjs-0.2.2 vs lib/minjs/ecma262/st.rb in minjs-0.3.0
- old
+ new
@@ -1235,12 +1235,12 @@
concat options, :debugger, ";"
end
end
#
- # 13 function / function expression
- #
+ # 13 function declaration
+ # 13 function expression
# 11.1.5 getter/setter
#
class StFunc < St
attr_reader :name
attr_reader :args
@@ -1285,15 +1285,19 @@
end
def to_js(options = {})
_args = @args.collect{|x|x.to_js(options)}.join(",")
if @getter
- concat options, :get, @name, '(', _args, ")", "{", @statements, "}"
+ concat options, :get, @name, "()", "{", @statements, "}"
elsif @setter
concat options, :set, @name, '(', _args, ")", "{", @statements, "}"
else
concat options, :function, @name, '(', _args, ")", "{", @statements, "}"
end
+ end
+
+ def left_hand_side_exp?
+ true
end
def getter?
@getter
end