From 663dbb9dae54d96027132dface33215126a0b715 Mon Sep 17 00:00:00 2001 From: Martin Yankov Date: Wed, 3 Apr 2019 16:15:31 +0300 Subject: [PATCH] chore: add deprecation console warnings (#7098) --- tns-core-modules/ui/core/view/view-common.ts | 9 ++++++++- tns-core-modules/ui/frame/frame.android.ts | 2 ++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tns-core-modules/ui/core/view/view-common.ts b/tns-core-modules/ui/core/view/view-common.ts index 1f14c34d6..9dfab6815 100644 --- a/tns-core-modules/ui/core/view/view-common.ts +++ b/tns-core-modules/ui/core/view/view-common.ts @@ -259,7 +259,14 @@ export abstract class ViewCommon extends ViewBase implements ViewDefinition { if (args.length === 2) { options = 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], diff --git a/tns-core-modules/ui/frame/frame.android.ts b/tns-core-modules/ui/frame/frame.android.ts index 1bf5e396d..f878f1709 100644 --- a/tns-core-modules/ui/frame/frame.android.ts +++ b/tns-core-modules/ui/frame/frame.android.ts @@ -952,6 +952,8 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks { const intent: android.content.Intent = superFunc ? 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 = intentOrSuperFunc; }