diff --git a/packages/vision-polyfill/src/bundle/bundle.ts b/packages/vision-polyfill/src/bundle/bundle.ts index b969512d9..2554101b4 100644 --- a/packages/vision-polyfill/src/bundle/bundle.ts +++ b/packages/vision-polyfill/src/bundle/bundle.ts @@ -44,7 +44,7 @@ function registerPrototypeViewWrapper(name: string, prototypeViewWrapper: Functi } } -function wrapperPrototypeView(view: ComponentClass) { +function wrapPrototypeView(view: ComponentClass) { const newView = prototypeViewWrapperList.reduce((acc, { prototypeViewWrapper }) => { return prototypeViewWrapper(acc.displayName, acc) || acc; }, view); @@ -200,7 +200,7 @@ export default class Bundle { viewDetail.displayName = getCamelName(viewName || item.name); } (viewDetail as any)._packageName_ = viewName || item.name; - this.viewsMap[viewDetail.displayName] = wrapperPrototypeView(viewDetail); + this.viewsMap[viewDetail.displayName] = wrapPrototypeView(viewDetail); }); } diff --git a/packages/vision-polyfill/tests/prototypeWrapper/index.js b/packages/vision-polyfill/tests/prototypeWrapper/index.js deleted file mode 100644 index 4b64e8ce5..000000000 --- a/packages/vision-polyfill/tests/prototypeWrapper/index.js +++ /dev/null @@ -1,24 +0,0 @@ -// const { Bundle } = window.VisualEngine; -// Bundle.registerPrototypeConfigPreprocessor('aaa', (componentName, config) => { -// if (componentName === 'Text') { -// config.configure[0].initialValue.zh_CN = 'XXXXXXXXXX'; -// return { -// ...config, -// }; -// } -// }); - -// Bundle.registerPrototypeViewWrapper('aaa', function (componentName, View) { -// return componentName === 'Text' -// ? class Wrapper extends window.React.Component { -// render() { -// return ( -//