nodes: removed o.chainRoot which went unused

This commit is contained in:
satyr
2010-10-02 08:33:57 +09:00
parent 8cdee9c0f4
commit 4fd878447e
2 changed files with 5 additions and 17 deletions

View File

@@ -28,9 +28,6 @@
var closure, code, top;
this.options = o ? merge(o) : {};
this.tab = o.indent;
if (!(this instanceof AccessorNode || this instanceof IndexNode)) {
del(this.options, 'chainRoot');
}
top = this.topSensitive() ? this.options.top : del(this.options, 'top');
closure = this.isStatement(o) && !this.isPureStatement() && !top && !this.options.asStatement && !(this instanceof CommentNode) && !this.containsPureStatement();
if (!o.keepLevel) {
@@ -374,7 +371,6 @@
return ex.compile(o);
}
props = this.properties;
o.chainRoot || (o.chainRoot = this);
if (this.parenthetical && !props.length) {
this.base.parenthetical = true;
}
@@ -520,7 +516,6 @@
if (node = this.unfoldSoak(o)) {
return node.compile(o);
}
o.chainRoot || (o.chainRoot = this);
if (this.exist) {
if (val = this.variable) {
if (!(val instanceof ValueNode)) {
@@ -626,9 +621,8 @@
AccessorNode.prototype["class"] = 'AccessorNode';
AccessorNode.prototype.children = ['name'];
AccessorNode.prototype.compileNode = function(o) {
var _base, name, namePart;
var name, namePart;
name = this.name.compile(o);
(_base = o.chainRoot).wrapped || (_base.wrapped = this.soakNode);
namePart = name.match(IS_STRING) ? ("[" + (name) + "]") : ("." + (name));
return this.prototype + namePart;
};
@@ -645,8 +639,7 @@
IndexNode.prototype["class"] = 'IndexNode';
IndexNode.prototype.children = ['index'];
IndexNode.prototype.compileNode = function(o) {
var _base, idx, prefix;
(_base = o.chainRoot).wrapped || (_base.wrapped = this.soakNode);
var idx, prefix;
idx = this.index.compile(o);
prefix = this.proto ? '.prototype' : '';
return "" + (prefix) + "[" + (idx) + "]";
@@ -1906,7 +1899,7 @@
};
TAB = ' ';
TRAILING_WHITESPACE = /[ \t]+$/gm;
IDENTIFIER = /^[$A-Za-zA-Z_][$\w]*$/;
IDENTIFIER = /^[$A-Za-z_][$\w]*$/;
NUMBER = /^0x[\da-f]+|^(?:\d+(\.\d+)?|\.\d+)(?:e[+-]?\d+)?$/i;
SIMPLENUM = /^-?\d+$/;
IS_STRING = /^['"]/;