Skip to content

Commit dee3ab0

Browse files
authored
Fix #180 - Custom with multi attr failure
Fix #180 - Themes can have multiple attributes - but not in safe mode
1 parent a8ce90c commit dee3ab0

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

lib/extendStringPrototype.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,16 @@ module['exports'] = function() {
7373
} else {
7474
if (typeof(theme[prop]) === 'string') {
7575
colors[prop] = colors[theme[prop]];
76-
addProperty(prop, function() {
77-
return colors[theme[prop]](this);
78-
});
7976
} else {
80-
addProperty(prop, function() {
81-
var ret = this;
82-
for (var t = 0; t < theme[prop].length; t++) {
83-
ret = colors[theme[prop][t]](ret);
84-
}
85-
return ret;
86-
});
77+
var tmp = colors[theme[prop][0]];
78+
for (var t = 1; t < theme[prop].length; t++) {
79+
tmp = tmp[theme[prop][t]];
80+
}
81+
colors[prop] = tmp;
8782
}
83+
addProperty(prop, function() {
84+
return colors[prop](this);
85+
});
8886
}
8987
});
9088
}

0 commit comments

Comments
 (0)