diff --git a/lib/coffee_script/nodes.js b/lib/coffee_script/nodes.js index 401de91d..5b037fb6 100644 --- a/lib/coffee_script/nodes.js +++ b/lib/coffee_script/nodes.js @@ -568,7 +568,7 @@ return this; }, compile_node: function compile_node(o) { - return 'this' + (this.property ? '.' + this.property : ''); + return 'this' + (this.property ? '.' + this.property.compile(o) : ''); } })); // A range literal. Ranges can be used to extract portions (slices) of arrays, diff --git a/src/nodes.coffee b/src/nodes.coffee index 82424be7..c97fdaa6 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -434,7 +434,7 @@ ThisNode: exports.ThisNode: inherit Node, { this compile_node: (o) -> - 'this' + (if @property then '.' + @property else '') + 'this' + (if @property then '.' + @property.compile(o) else '') }