dynakeys: work again on JScript

This commit is contained in:
satyr 2010-11-11 16:17:56 +09:00
parent 2c7f6d8bfe
commit a2d33112b8
3 changed files with 9 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -730,7 +730,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;
}
}
@ -748,11 +748,10 @@
}).call(this));
lastNoncom = last(nonComments);
props = (function() {
_ref = this.properties;
_results = [];
for (i = 0, _len2 = _ref.length; i < _len2; i++) {
prop = _ref[i];
join = i === this.properties.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
for (i = 0, _len2 = props.length; i < _len2; 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');
@ -762,7 +761,7 @@
_results.push(indent + prop.compile(o, LEVEL_TOP) + join);
}
return _results;
}).call(this);
})();
props = props.join('');
obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}";
if (rest) {

View File

@ -579,13 +579,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'