Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: extend get/set property method removal from 9.0.0 to 10.0.0 #11455

Merged
merged 1 commit into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ void ${className}::${method.apiName}(const FunctionCallbackInfo<Value>& args)

<#if method.args?size == 0 && name[0..2] == "get" && isDynamic>
<#assign propertyName = name[3]?lower_case + name[4..]>
LOGW(TAG, "Automatic getter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 9.0.0. Please access the property in standard JS style: obj.${propertyName}; or obj['${propertyName}'];");
LOGW(TAG, "Automatic getter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 10.0.0. Please access the property in standard JS style: obj.${propertyName}; or obj['${propertyName}'];");
<#elseif method.args?size == 1 && name[0..2] == "set" && isDynamic>
<#assign propertyName = name[3]?lower_case + name[4..]>
LOGW(TAG, "Automatic setter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 9.0.0. Please modify the property in standard JS style: obj.${propertyName} = value; or obj['${propertyName}'] = value;");
LOGW(TAG, "Automatic setter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 10.0.0. Please modify the property in standard JS style: obj.${propertyName} = value; or obj['${propertyName}'] = value;");
</#if>

jobject javaProxy = proxy->getJavaObject();
Expand Down
4 changes: 2 additions & 2 deletions android/runtime/v8/src/native/Proxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void Proxy::getProperty(const FunctionCallbackInfo<Value>& args)

// Spit out deprecation notice to use normal property getter
v8::String::Utf8Value propertyKey(isolate, name);
LOGW(TAG, "Automatic getter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 9.0.0. Please access the property in standard JS style: obj.%s; or obj['%s'];", *propertyKey, *propertyKey);
LOGW(TAG, "Automatic getter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 10.0.0. Please access the property in standard JS style: obj.%s; or obj['%s'];", *propertyKey, *propertyKey);

args.GetReturnValue().Set(getPropertyForProxy(isolate, name, args.Holder()));
}
Expand Down Expand Up @@ -213,7 +213,7 @@ void Proxy::onPropertyChanged(const v8::FunctionCallbackInfo<v8::Value>& args)
Local<Name> name = args.Data().As<Name>();
// Spit out deprecation notice to use normal property setter, not setX() style method.
v8::String::Utf8Value propertyKey(isolate, name);
LOGW(TAG, "Automatic setter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 9.0.0. Please modify the property in standard JS style: obj.%s = value; or obj['%s'] = value;", *propertyKey, *propertyKey);
LOGW(TAG, "Automatic setter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 10.0.0. Please modify the property in standard JS style: obj.%s = value; or obj['%s'] = value;", *propertyKey, *propertyKey);

Local<Value> value = args[0];
Local<Context> context = isolate->GetCurrentContext();
Expand Down
2 changes: 1 addition & 1 deletion iphone/TitaniumKit/TitaniumKit/Sources/API/ObjcProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#import <JavaScriptCore/JavaScriptCore.h>
#import <pthread.h>

// Macros to make life easier for defining properties with getters/setter accessor methods (which we'll remove in SDK 9.0.0
// Macros to make life easier for defining properties with getters/setter accessor methods (which we'll remove in SDK 10.0.0

// Defines a setProp() accessor method in JS-world that points to setterProp:(TYPE)value in native code
#define SETTER(TYPE, NAME) JSExportAs(set##NAME, -(void)setter##NAME \
Expand Down
4 changes: 2 additions & 2 deletions iphone/TitaniumKit/TitaniumKit/Sources/Kroll/KrollMethod.m
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ - (id)call:(NSArray *)args
// This is the code path followed for delegating access for soemthing like
// Ti.UI.Label#setText(). Which delegates through TiProxy.m TiProxyDelegate code
// Other code path is handled in KrollObject.m
DebugLog(@"[WARN] Automatic setter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 9.0.0. Please modify the property in standard JS style: obj.%@ = value; or obj['%@'] = value;", name, name);
DebugLog(@"[WARN] Automatic setter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 10.0.0. Please modify the property in standard JS style: obj.%@ = value; or obj['%@'] = value;", name, name);
id newValue = [KrollObject nonNull:[args objectAtIndex:0]];
[self updateJSObjectWithValue:newValue forKey:name];
[target setValue:newValue forKey:name];
Expand All @@ -241,7 +241,7 @@ - (id)call:(NSArray *)args
// This is the code path followed for delegating access for something like
// Ti.UI.Label#getText(). Which delegates through TiProxy.m TiProxyDelegate code
// Other code path is handled in KrollObject.m
DebugLog(@"[WARN] Automatic getter methods for properties are in SDK 8.0.0 and will be removed in SDK 9.0.0. Please access the property in standard JS style: obj.%@ or obj['%@']", name, name);
DebugLog(@"[WARN] Automatic getter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 10.0.0. Please access the property in standard JS style: obj.%@ or obj['%@']", name, name);
// hold, see below
id result = [target valueForKey:name];
[self updateJSObjectWithValue:result forKey:name];
Expand Down
4 changes: 2 additions & 2 deletions iphone/TitaniumKit/TitaniumKit/Sources/Kroll/KrollObject.m
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ - (id)_valueForKey:(NSString *)key
if ([target respondsToSelector:NSSelectorFromString(propertyKey)]) {
// This is the code path for delegating something like Ti.Filesystem.File#setHidden(), see KrollMethod for other cases (when type is KrollMethodPropertySetter, the last option in this if block below)
// Spit out a deprecation warning to use normal property setter!
DebugLog(@"[WARN] Automatic setter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 9.0.0. Please modify the property in standard JS style: obj.%@ = value; or obj['%@'] = value;", propertyKey, propertyKey);
DebugLog(@"[WARN] Automatic setter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 10.0.0. Please modify the property in standard JS style: obj.%@ = value; or obj['%@'] = value;", propertyKey, propertyKey);
}
[result setSelector:selector];
} else {
Expand Down Expand Up @@ -619,7 +619,7 @@ - (id)_valueForKey:(NSString *)key
if ([target respondsToSelector:selector]) {
// Spit out a deprecation warning to use normal property accessor!
// This is the code path for delegating something like Ti.Filesystem.File#getHidden(), see KrollMethod for other cases (when type is KrollMethodPropertyGetter, the last option in this if block below)
DebugLog(@"[WARN] Automatic getter methods for properties are in SDK 8.0.0 and will be removed in SDK 9.0.0. Please access the property in standard JS style: obj.%@ or obj['%@']", partkey, partkey);
DebugLog(@"[WARN] Automatic getter methods for properties are deprecated in SDK 8.0.0 and will be removed in SDK 10.0.0. Please access the property in standard JS style: obj.%@ or obj['%@']", partkey, partkey);
[result setSelector:selector];
[result setType:KrollMethodGetter];
return [result autorelease];
Expand Down