mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
resolving merge
This commit is contained in:
commit
21111755cf
3 changed files with 10 additions and 11 deletions
File diff suppressed because one or more lines are too long
13
lib/nodes.js
13
lib/nodes.js
|
@ -669,7 +669,7 @@
|
|||
__extends(Obj, Base);
|
||||
Obj.prototype.children = ['properties'];
|
||||
Obj.prototype.compileNode = function(o) {
|
||||
var i, idt, indent, join, lastNoncom, nonComments, obj, prop, props, rest, _i, _len, _len2, _len3, _ref, _ref2, _results, _results2;
|
||||
var i, idt, indent, join, lastNoncom, nonComments, obj, prop, props, rest, _i, _len, _len2, _len3, _ref, _results, _results2;
|
||||
props = this.properties;
|
||||
if (!props.length) {
|
||||
if (this.front) {
|
||||
|
@ -681,7 +681,7 @@
|
|||
for (i = 0, _len = props.length; i < _len; i++) {
|
||||
prop = props[i];
|
||||
if (prop instanceof Splat || (prop.variable || prop).base instanceof Parens) {
|
||||
rest = this.properties.splice(i);
|
||||
rest = props.splice(i, 1 / 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -699,11 +699,10 @@
|
|||
}).call(this));
|
||||
lastNoncom = last(nonComments);
|
||||
props = (function() {
|
||||
_ref2 = this.properties;
|
||||
_results2 = [];
|
||||
for (i = 0, _len3 = _ref2.length; i < _len3; i++) {
|
||||
prop = _ref2[i];
|
||||
join = i === this.properties.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
|
||||
for (i = 0, _len3 = props.length; i < _len3; i++) {
|
||||
prop = props[i];
|
||||
join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
|
||||
indent = prop instanceof Comment ? '' : idt;
|
||||
if (prop instanceof Value && prop["this"]) {
|
||||
prop = new Assign(prop.properties[0].name, prop, 'object');
|
||||
|
@ -713,7 +712,7 @@
|
|||
_results2.push(indent + prop.compile(o, LEVEL_TOP) + join);
|
||||
}
|
||||
return _results2;
|
||||
}).call(this);
|
||||
})();
|
||||
props = props.join('');
|
||||
obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}";
|
||||
if (rest) {
|
||||
|
|
|
@ -576,13 +576,13 @@ exports.Obj = class Obj extends Base
|
|||
return (if @front then '({})' else '{}') unless props.length
|
||||
for prop, i in props
|
||||
if prop instanceof Splat or (prop.variable or prop).base instanceof Parens
|
||||
rest = @properties.splice i
|
||||
rest = props.splice i, 1/0
|
||||
break
|
||||
idt = o.indent += TAB
|
||||
nonComments = (prop for prop in @properties when prop not instanceof Comment)
|
||||
lastNoncom = last nonComments
|
||||
props = for prop, i in @properties
|
||||
join = if i is @properties.length - 1
|
||||
props = for prop, i in props
|
||||
join = if i is props.length - 1
|
||||
''
|
||||
else if prop is lastNoncom or prop instanceof Comment
|
||||
'\n'
|
||||
|
|
Loading…
Reference in a new issue