Fixed: @ref did not generate self.x for an ivar x

This commit is contained in:
Martin Carlberg
2014-12-02 13:54:02 +01:00
parent b2557c38dd
commit ee13978115
4 changed files with 23 additions and 2 deletions
+2 -2
View File
@@ -2381,9 +2381,9 @@ Reference: function(node, st, c) {
buffer.concat(" "); // Add an extra space if it looks something like this: "return(<expression>)". No space between return and expression.
}
buffer.concat("function(__input) { if (arguments.length) return ");
buffer.concat(node.element.name);
c(node.element, st, "Expression");
buffer.concat(" = __input; return ");
buffer.concat(node.element.name);
c(node.element, st, "Expression");
buffer.concat("; }");
if (!generate) compiler.lastPos = node.end;
},
@@ -0,0 +1,11 @@
@implementation TC
{
id _control;
}
- (id)a
{
@ref(_control);
}
@end
@@ -0,0 +1,9 @@
{var the_class = objj_allocateClassPair(Nil, "TC"),
meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_control")]);objj_registerClassPair(the_class);
class_addMethods(the_class, [new objj_method(sel_getUid("a"), function $TC__a(self, _cmd)
{
function(__input) { if (arguments.length) return self._control = __input; return self._control; };
}
,["id"])]);
}
@@ -22,6 +22,7 @@ var FILENAMES = [
"Misc/regex-simple-char-classes",
"Misc/empty-loops",
"Misc/empty-statements",
"Misc/ref-self",
];
@implementation OutputTest : OJTestCase