mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-27 04:37:41 +00:00
Fixed: @ref did not generate self.x for an ivar x
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user