adding paren wrappers for property accesses directly on object literals

This commit is contained in:
Jeremy Ashkenas
2010-02-15 19:13:08 -05:00
parent 639be2ff09
commit 63c2b2bc64
3 changed files with 7 additions and 0 deletions

View File

@@ -257,6 +257,7 @@ ValueNode: exports.ValueNode: inherit Node, {
only: del(o, 'only_first')
props: if only then @properties[0...@properties.length - 1] else @properties
baseline: @base.compile o
baseline: '(' + baseline + ')' if @base instanceof ObjectNode and @has_properties()
parts: [baseline]
for prop in props