chore: add deprecation console warnings (#7098)

This commit is contained in:
Martin Yankov
2019-04-03 16:15:31 +03:00
committed by GitHub
parent 3efc06ed98
commit 663dbb9dae
2 changed files with 10 additions and 1 deletions

View File

@ -259,7 +259,14 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition {
if (args.length === 2) {
options = <ShowModalOptions>args[1];
} else {
// TODO: Add deprecation warning
if (args[0] instanceof ViewCommon) {
console.log("showModal(view: ViewBase, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean) " +
"is deprecated. Use showModal(view: ViewBase, modalOptions: ShowModalOptions) instead.");
} else {
console.log("showModal(moduleName: string, context: any, closeCallback: Function, fullscreen?: boolean, animated?: boolean, stretched?: boolean) " +
"is deprecated. Use showModal(moduleName: string, modalOptions: ShowModalOptions) instead.");
}
options = {
context: args[1],
closeCallback: args[2],

View File

@ -952,6 +952,8 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
const intent: android.content.Intent = superFunc ? <android.content.Intent>intentOrSuperFunc : undefined;
if (!superFunc) {
console.log("AndroidActivityCallbacks.onCreate(activity: any, savedInstanceState: any, superFunc: Function) " +
"is deprecated. Use AndroidActivityCallbacks.onCreate(activity: any, savedInstanceState: any, intent: any, superFunc: Function) instead.");
superFunc = <Function>intentOrSuperFunc;
}