js:compat es5,use context.sendNative to replace Proxy

This commit is contained in:
pengfei.zhou
2020-01-17 16:51:17 +08:00
committed by osborn
parent c813787318
commit b6f7588321
30 changed files with 461 additions and 414 deletions

View File

@@ -131,7 +131,7 @@ export declare abstract class View implements Modeling, IView {
also(block: (it: this) => void): this;
apply(config: IView): this;
in(group: Group): this;
nativeChannel(context: any, name: string): (args?: any) => Promise<any>;
nativeChannel(context: BridgeContext, name: string): (args?: any) => Promise<any>;
getWidth(context: BridgeContext): Promise<number>;
getHeight(context: BridgeContext): Promise<number>;
getLocationOnScreen(context: BridgeContext): Promise<{

View File

@@ -149,7 +149,6 @@ export class View {
nativeChannel(context, name) {
let thisView = this;
return function (args = undefined) {
const func = context.shader.command;
const viewIds = [];
while (thisView != undefined) {
viewIds.push(thisView.viewId);
@@ -160,7 +159,7 @@ export class View {
name,
args,
};
return Reflect.apply(func, undefined, [params]);
return context.callNative('shader', 'command', params);
};
}
getWidth(context) {
@@ -222,10 +221,6 @@ __decorate([
Property,
__metadata("design:type", Boolean)
], View.prototype, "hidden", void 0);
__decorate([
Property,
__metadata("design:type", Object)
], View.prototype, "viewId", void 0);
__decorate([
Property,
__metadata("design:type", Object)