mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
@@ -155,10 +155,6 @@ const applyComponentAttributes = profile('applyComponentAttributes', (instance:
|
||||
}
|
||||
}
|
||||
|
||||
console.log('applyComponentAttributes called for attr:', attr, 'with value:', attrValue);
|
||||
if (attr === 'navigatingTo') {
|
||||
console.log('@@@ navigatingTo moduleExports:', moduleExports);
|
||||
}
|
||||
if (attr.indexOf('.') !== -1) {
|
||||
let subObj = instance;
|
||||
const properties = attr.split('.');
|
||||
@@ -189,9 +185,6 @@ export function getComponentModule(elementName: string, namespace: string, attri
|
||||
|
||||
const { instance, instanceModule } = createComponentInstance(elementName, namespace, null);
|
||||
moduleExports = getComponentModuleExports(instance, <any>moduleExports, attributes);
|
||||
console.log('getComponentModule called for element:', elementName, 'with namespace:', namespace, 'and attributes:', attributes);
|
||||
console.log('moduleExports ---');
|
||||
console.log(moduleExports);
|
||||
if (isRootComponent) {
|
||||
applyComponentCss(instance, moduleNamePath, attributes);
|
||||
}
|
||||
@@ -209,7 +202,6 @@ export function getComponentModule(elementName: string, namespace: string, attri
|
||||
export function setPropertyValue(instance: View, instanceModule: Object, exports: Object, propertyName: string, propertyValue: any) {
|
||||
// Note: instanceModule can be null if we are loading custom component with no code-behind.
|
||||
if (isBinding(propertyValue) && instance.bind) {
|
||||
console.log('1 setPropertyValue, Binding detected for property:', propertyName, 'with value:', propertyValue);
|
||||
const bindOptions = getBindingOptions(propertyName, getBindingExpressionFromAttribute(propertyValue));
|
||||
instance.bind(
|
||||
{
|
||||
@@ -221,8 +213,6 @@ export function setPropertyValue(instance: View, instanceModule: Object, exports
|
||||
bindOptions[bindingConstants.source],
|
||||
);
|
||||
} else if (isEventOrGesture(propertyName, instance)) {
|
||||
console.log('2 setPropertyValue, Binding detected for property:', propertyName, 'with value:', propertyValue);
|
||||
console.log('setPropertyValue, exports:', exports);
|
||||
// Get the event handler from page module exports.
|
||||
const handler = exports && exports[propertyValue];
|
||||
|
||||
@@ -231,10 +221,8 @@ export function setPropertyValue(instance: View, instanceModule: Object, exports
|
||||
instance.on(propertyName, handler);
|
||||
}
|
||||
} else if (isKnownFunction(propertyName, instance) && exports && typeof exports[propertyValue] === 'function') {
|
||||
console.log('3 setPropertyValue, Binding detected for property:', propertyName, 'with value:', propertyValue);
|
||||
instance[propertyName] = exports[propertyValue];
|
||||
} else {
|
||||
console.log('4 setPropertyValue, Binding detected for property:', propertyName, 'with value:', propertyValue);
|
||||
instance[propertyName] = propertyValue;
|
||||
}
|
||||
}
|
||||
@@ -249,7 +237,6 @@ function isBinding(value: any): boolean {
|
||||
const str = value.trim();
|
||||
isBinding = str.indexOf('{{') === 0 && str.lastIndexOf('}}') === str.length - 2;
|
||||
}
|
||||
console.log('isBinding called with value:', value, ' isBinding:', isBinding);
|
||||
|
||||
return isBinding;
|
||||
}
|
||||
|
||||
@@ -73,9 +73,11 @@ 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('Resolved code module name:', resolvedCodeModuleName, ' exports:', moduleExports);
|
||||
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();
|
||||
@@ -141,7 +143,7 @@ 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'];
|
||||
}
|
||||
}
|
||||
@@ -184,7 +186,6 @@ export function createViewFromEntry(entry: ViewEntry): View {
|
||||
|
||||
function loadInternal(moduleName: string, moduleExports: any): ComponentModule {
|
||||
let componentModule: ComponentModule;
|
||||
console.log('loadInternal called for moduleName:', moduleName, 'with moduleExports:', moduleExports);
|
||||
const resolvedXmlModule = resolveModuleName(moduleName, 'xml');
|
||||
|
||||
if (resolvedXmlModule) {
|
||||
@@ -285,7 +286,6 @@ export function getExports(instance: ViewBase): any {
|
||||
}
|
||||
|
||||
function parseInternal(value: string, context: any, xmlModule?: string, moduleName?: string): ComponentModule {
|
||||
console.log('parseInternal called with value:', value, 'context:', context, 'xmlModule:', xmlModule, 'moduleName:', moduleName);
|
||||
if (__UI_USE_XML_PARSER__) {
|
||||
let start: xml2ui.XmlStringParser;
|
||||
let ui: xml2ui.ComponentParser;
|
||||
@@ -668,7 +668,6 @@ export namespace xml2ui {
|
||||
|
||||
@profile
|
||||
private buildComponent(args: xml.ParserEvent): ComponentModule {
|
||||
console.log('ComponentParser.buildComponent called for element:', args.elementName, 'with namespace:', args.namespace, 'and attributes:', args.attributes, 'context:', this.context);
|
||||
if (args.prefix && args.namespace) {
|
||||
// Custom components
|
||||
return loadCustomComponent(args.namespace, args.elementName, args.attributes, this.context, this.currentRootView, !this.currentRootView, this.moduleName);
|
||||
|
||||
Reference in New Issue
Block a user