vona-core 5.1.31 → 5.1.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -873,22 +873,26 @@ class BeanBaseSimple extends BeanSimple {
|
|
|
873
873
|
}
|
|
874
874
|
}
|
|
875
875
|
|
|
876
|
-
|
|
876
|
+
// import type { IModuleLocaleText } from './resource/locale/type.ts';
|
|
877
|
+
|
|
878
|
+
|
|
879
|
+
// const SymbolText = Symbol('SymbolText');
|
|
877
880
|
const SymbolLogger = Symbol('SymbolLogger');
|
|
878
881
|
const SymbolLoggerChildren = Symbol('SymbolLoggerChildren');
|
|
879
882
|
class BeanBase extends BeanBaseSimple {
|
|
880
883
|
constructor(...args) {
|
|
881
884
|
super(...args);
|
|
882
|
-
|
|
885
|
+
// private [SymbolText]: IModuleLocaleText;
|
|
883
886
|
this[SymbolLogger] = {};
|
|
884
887
|
this[SymbolLoggerChildren] = {};
|
|
885
888
|
}
|
|
886
|
-
get $text() {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
}
|
|
889
|
+
// protected get $text(): IModuleLocaleText {
|
|
890
|
+
// if (!this[SymbolText]) {
|
|
891
|
+
// this[SymbolText] = this.app.meta.locale.createLocaleText(this[SymbolModuleBelong]);
|
|
892
|
+
// }
|
|
893
|
+
// return this[SymbolText];
|
|
894
|
+
// }
|
|
895
|
+
|
|
892
896
|
get $logger() {
|
|
893
897
|
return this.$loggerClient('default');
|
|
894
898
|
}
|
|
@@ -1560,19 +1564,19 @@ class BeanContainer {
|
|
|
1560
1564
|
fn = function ([receiver, _], next) {
|
|
1561
1565
|
const beanInstance = self.app.bean._getBean(aopMethod.beanFullName);
|
|
1562
1566
|
if (!beanInstance.get) throw new Error(`get property accessor not exists: ${aopMethod.onionName}`);
|
|
1563
|
-
return beanInstance.get(aopMethod.options,
|
|
1567
|
+
return beanInstance.get(aopMethod.options, _patchAopMethodNext([receiver, _], next), receiver, prop);
|
|
1564
1568
|
};
|
|
1565
1569
|
} else if (methodType === 'set') {
|
|
1566
1570
|
fn = function ([receiver, value], next) {
|
|
1567
1571
|
const beanInstance = self.app.bean._getBean(aopMethod.beanFullName);
|
|
1568
1572
|
if (!beanInstance.set) throw new Error(`set property accessor not exists: ${aopMethod.onionName}`);
|
|
1569
|
-
return beanInstance.set(aopMethod.options, value,
|
|
1573
|
+
return beanInstance.set(aopMethod.options, value, _patchAopMethodNext([receiver, value], next), receiver, prop);
|
|
1570
1574
|
};
|
|
1571
1575
|
} else if (methodType === 'method') {
|
|
1572
1576
|
fn = function ([receiver, args], next) {
|
|
1573
1577
|
const beanInstance = self.app.bean._getBean(aopMethod.beanFullName);
|
|
1574
1578
|
if (!beanInstance.execute) throw new Error(`execute method not exists: ${aopMethod.onionName}`);
|
|
1575
|
-
return beanInstance.execute(aopMethod.options, args,
|
|
1579
|
+
return beanInstance.execute(aopMethod.options, args, _patchAopMethodNext([receiver, args], next), receiver, prop);
|
|
1576
1580
|
};
|
|
1577
1581
|
}
|
|
1578
1582
|
chains.push([aopKey, fn]);
|
|
@@ -1598,6 +1602,17 @@ function _patchAopNext([receiver, context], next) {
|
|
|
1598
1602
|
return next([receiver, context]);
|
|
1599
1603
|
};
|
|
1600
1604
|
}
|
|
1605
|
+
function _patchAopMethodNext([receiver, context], next) {
|
|
1606
|
+
const nextPatched = (...args) => {
|
|
1607
|
+
context = args.length === 0 ? context : args[0];
|
|
1608
|
+
return next([receiver, context]);
|
|
1609
|
+
};
|
|
1610
|
+
nextPatched.replay = (...args) => {
|
|
1611
|
+
const nextContext = args.length === 0 ? context : args[0];
|
|
1612
|
+
return next.replay([receiver, nextContext]);
|
|
1613
|
+
};
|
|
1614
|
+
return nextPatched;
|
|
1615
|
+
}
|
|
1601
1616
|
function __checkAopOfDescriptorInfo(descriptorInfo) {
|
|
1602
1617
|
if (!descriptorInfo) return true;
|
|
1603
1618
|
return !descriptorInfo.dynamic && !descriptorInfo.ofBeanBase;
|