chore: cleanup

This commit is contained in:
Nathan Walker
2025-07-22 22:46:15 -07:00
parent b853447da2
commit b79801af5f
12 changed files with 3 additions and 38 deletions

View File

@ -23,7 +23,6 @@ function runTests() {
export function onNavigatedTo(args) {
args.object.off(Page.loadedEvent, onNavigatedTo);
console.log('onNavigatedTo called', executeTests);
if (executeTests) {
executeTests = false;
runTests();

View File

@ -455,7 +455,6 @@ function getAllProperties(obj: any) {
let testsSelector: string;
export function runAll(testSelector?: string) {
testsSelector = testSelector;
console.log('runAll called with:', testSelector);
if (running) {
// TODO: We may schedule pending run requests
return;

View File

@ -359,7 +359,6 @@ export function waitUntilReady(isReady: () => boolean, timeoutSec: number = 5, s
const currentRunLoop = NSRunLoop.currentRunLoop;
currentRunLoop.limitDateForMode(currentRunLoop.currentMode);
if (isReady()) {
console.log('waitUntilReady: isReady() returned true');
break;
}

View File

@ -203,13 +203,11 @@ export function waitUntilNavigatedFrom(action: Function, topFrame?: Frame) {
const currentPage = topFrame ? topFrame.currentPage : Frame.topmost().currentPage;
let completed = false;
function navigatedFrom(args) {
console.log('navigatedFrom called');
args.object.page.off('navigatedFrom', navigatedFrom);
completed = true;
}
currentPage.on('navigatedFrom', navigatedFrom);
console.log('calling action!');
action();
TKUnit.waitUntilReady(() => completed);
}

View File

@ -2,7 +2,6 @@ import { EventData, Page, Utils } from '@nativescript/core';
import { HelloWorldModel } from './main-view-model';
export function navigatingTo(args: EventData) {
console.log('toolbox navigatingTo called');
const page = <Page>args.object;
page.bindingContext = new HelloWorldModel();

View File

@ -1,5 +1,5 @@
import { encoding as textEncoding } from '../text';
import { iOSNativeHelper } from '../utils';
import { getFileExtension, iOSNativeHelper } from '../utils';
// TODO: Implement all the APIs receiving callback using async blocks
// TODO: Check whether we need try/catch blocks for the iOS implementation
@ -611,24 +611,8 @@ export class FileSystemAccess {
return url.path;
}
// TODO: This method is the same as in the iOS implementation.
// Make it in a separate file / module so it can be reused from both implementations.
public getFileExtension(path: string): string {
// TODO [For Panata]: The definitions currently specify "any" as a return value of this method
//const nsString = Foundation.NSString.stringWithString(path);
//const extension = nsString.pathExtension();
//if (extension && extension.length > 0) {
// extension = extension.concat(".", extension);
//}
//return extension;
const dotIndex = path.lastIndexOf('.');
if (dotIndex && dotIndex >= 0 && dotIndex < path.length) {
return path.substring(dotIndex);
}
return '';
return getFileExtension(path);
}
private deleteEntity(path: string, onError?: (error: any) => any) {

View File

@ -104,7 +104,6 @@ global._unregisterModule = function _unregisterModule(name: string): void {
global.registerBundlerModules = function registerBundlerModules(context: Context, extensionMap: ExtensionMap = {}) {
const registerWithName = (nickName: string, moduleId: string) => {
console.log(`Registering module '${nickName}' with id '${moduleId}'`);
modules.set(nickName, {
moduleId,
loader: () => {
@ -114,7 +113,6 @@ global.registerBundlerModules = function registerBundlerModules(context: Context
};
const registerModuleById = (moduleId: string) => {
console.log(`registerModuleById: ${moduleId}`);
const extDotIndex = moduleId.lastIndexOf('.');
const base = moduleId.substring(0, extDotIndex);
const originalExt = moduleId.substring(extDotIndex);
@ -129,7 +127,7 @@ global.registerBundlerModules = function registerBundlerModules(context: Context
if (registerName.startsWith('./') && registerName.endsWith('.js')) {
const jsNickNames = [
// This is extremely short version like "main-page" that was promoted to be used with global.registerModule("module-name", loaderFunc);
registerName.substring(2, registerName.length - 5),
registerName.substring(2, registerName.length - 3),
// This is for supporting module names like "./main/main-page"
registerName.substring(0, registerName.length - 3),
// This is for supporting module names like "main/main-page.js"
@ -398,7 +396,5 @@ function isTestingEnv() {
return typeof jest !== 'undefined' || global.__UNIT_TEST__;
}
console.log('isTestingEnv():', isTestingEnv());
// ensure the Application instance is initialized before any other module imports it.
import '../application';

View File

@ -20,7 +20,6 @@ export class ModuleNameResolver implements ModuleNameResolverType {
let result: string = this._cache[key];
if (result === undefined) {
result = this.resolveModuleNameImpl(path, ext);
console.log('resolveModuleName result:', result);
this._cache[key] = result;
}

View File

@ -176,8 +176,6 @@ export function findMatch(path: string, ext: string, candidates: Array<string>,
result = candidates[i];
}
}
console.log(' > findMatch called with path:', path, 'and ext:', ext, 'candidates:', candidates, 'context:', context, '--- MATCH? result:', result);
console.log('. ');
return result;
}

View File

@ -73,11 +73,8 @@ export class Builder {
return view;
} else if (entry.moduleName) {
const moduleName = sanitizeModuleName(entry.moduleName);
console.log('.');
console.log('moduleName:', moduleName);
const resolvedCodeModuleName = resolveModuleName(moduleName, ''); //`${moduleName}.xml`;
const moduleExports = resolvedCodeModuleName ? global.loadModule(resolvedCodeModuleName) : null;
console.log('createViewFromEntry called with entry:', entry, 'moduleName:', entry.moduleName, 'resolvedCodeModuleName:', resolvedCodeModuleName, 'moduleExports:', moduleExports);
if (moduleExports && moduleExports.createPage) {
// Exports has a createPage() method
const view = moduleExports.createPage();
@ -143,7 +140,6 @@ export class Builder {
*/
static parseMultipleTemplates(value: string, context: any): Array<KeyedTemplate> {
const dummyComponent = `<ListView><ListView.itemTemplates>${value}</ListView.itemTemplates></ListView>`;
console.log('parseMultipleTemplates called with value:', value, 'context:', context);
return parseInternal(dummyComponent, context).component['itemTemplates'];
}
}

View File

@ -226,7 +226,6 @@ export class FrameBase extends CustomLayoutView {
}
public navigate(param: any) {
console.log('framebase navigate() called with:', param);
if (Trace.isEnabled()) {
Trace.write(`NAVIGATE`, Trace.categories.Navigation);
}

View File

@ -135,7 +135,6 @@ export class PageBase extends ContentView {
@profile
public onNavigatedTo(isBackNavigation: boolean): void {
console.log('onNavigatedTo called with isBackNavigation:', isBackNavigation);
this.notify(this.createNavigatedData(PageBase.navigatedToEvent, isBackNavigation));
if (this.accessibilityAnnouncePageEnabled) {