From e71cbfbde2968a533a0e99d3e0fe616c30f64ad0 Mon Sep 17 00:00:00 2001 From: Ross Boucher Date: Thu, 2 Dec 2010 10:06:10 -0800 Subject: [PATCH] Need to re-examine this. Revert "Make @accessors generating code with static type. Not id only. This is useful when check ivar infomation from class_copyMethodList(YourClass)." This reverts commit c713a3fb25f0913efa5658f65a1dc9eeb53650bb. --- Objective-J/Preprocessor.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Objective-J/Preprocessor.js b/Objective-J/Preprocessor.js index 04a9070ea..75ee38697 100644 --- a/Objective-J/Preprocessor.js +++ b/Objective-J/Preprocessor.js @@ -456,10 +456,7 @@ Preprocessor.prototype.implementation = function(tokens, /*StringBuffer*/ aStrin { token = tokens.next(); if (token === TOKEN_ACCESSORS) - { attributes = this.accessors(tokens); - attributes["type"] = declaration[0]; - } else if (token !== TOKEN_OUTLET) throw new SyntaxError(this.error_message("*** Unexpected '@' token in ivar declaration ('@"+token+"').")); } @@ -505,12 +502,11 @@ Preprocessor.prototype.implementation = function(tokens, /*StringBuffer*/ aStrin for (ivar_name in accessors) { var accessor = accessors[ivar_name], - ivar_type = accessor["type"] || "id", property = accessor["property"] || ivar_name; // getter var getterName = accessor["getter"] || property, - getterCode = "(" + ivar_type + ")" + getterName + "\n{\nreturn " + ivar_name + ";\n}"; + getterCode = "(id)" + getterName + "\n{\nreturn " + ivar_name + ";\n}"; if (IS_NOT_EMPTY(instance_methods)) CONCAT(instance_methods, ",\n"); @@ -529,7 +525,7 @@ Preprocessor.prototype.implementation = function(tokens, /*StringBuffer*/ aStrin setterName = (start ? "_" : "") + "set" + property.substr(start, 1).toUpperCase() + property.substring(start + 1) + ":"; } - var setterCode = "(void)" + setterName + "(" + ivar_type + ")newValue\n{\n"; + var setterCode = "(void)" + setterName + "(id)newValue\n{\n"; if (accessor["copy"]) setterCode += "if (" + ivar_name + " !== newValue)\n" + ivar_name + " = [newValue copy];\n}";