mirror of
https://gitee.com/openharmony/developtools_ace_ets2bundle
synced 2024-12-18 06:48:35 +00:00
!3369 @Builder param 判断防护
Merge pull request !3369 from Bo Jiang/builder
This commit is contained in:
commit
3dfef67e76
@ -1735,10 +1735,16 @@ function addForEachId(node: ts.ExpressionStatement, isGlobalBuilder: boolean = f
|
||||
|
||||
export function parentConditionalExpression(builderInnerComponent: boolean = false): ts.ConditionalExpression {
|
||||
return ts.factory.createConditionalExpression(
|
||||
projectConfig.minAPIVersion >= 12 && builderInnerComponent ? ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT),
|
||||
ts.factory.createToken(ts.SyntaxKind.InstanceOfKeyword),
|
||||
ts.factory.createIdentifier(PUV2_VIEW_BASE)) :
|
||||
builderInnerComponent ? ts.factory.createBinaryExpression(
|
||||
ts.factory.createBinaryExpression(
|
||||
ts.factory.createTypeOfExpression(ts.factory.createIdentifier(PUV2_VIEW_BASE)),
|
||||
ts.factory.createToken(ts.SyntaxKind.ExclamationEqualsEqualsToken),
|
||||
ts.factory.createStringLiteral(COMPONENT_IF_UNDEFINED)
|
||||
),
|
||||
ts.factory.createToken(ts.SyntaxKind.AmpersandAmpersandToken), ts.factory.createBinaryExpression(
|
||||
ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT),
|
||||
ts.factory.createToken(ts.SyntaxKind.InstanceOfKeyword),
|
||||
ts.factory.createIdentifier(PUV2_VIEW_BASE))) :
|
||||
ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT),
|
||||
ts.factory.createToken(ts.SyntaxKind.QuestionToken),
|
||||
ts.factory.createIdentifier(COMPONENT_CONSTRUCTOR_PARENT),
|
||||
|
@ -102,7 +102,7 @@ class Index extends ViewPU {
|
||||
{
|
||||
this.observeComponentCreation2((elmtId, isInitialRender) => {
|
||||
if (isInitialRender) {
|
||||
let componentCall = new AAA(parent ? parent : this, { AAA: ComA }, undefined, elmtId, () => { }, { page: "@builderOrComponentAsName.ets", line: 10, col: 5 });
|
||||
let componentCall = new AAA(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, { AAA: ComA }, undefined, elmtId, () => { }, { page: "@builderOrComponentAsName.ets", line: 10, col: 5 });
|
||||
ViewPU.create(componentCall);
|
||||
let paramsLambda = () => {
|
||||
return {
|
||||
|
@ -164,7 +164,7 @@ function testIfIdComponent(value, parent = null) {
|
||||
{
|
||||
(parent ? parent : this).observeComponentCreation2((elmtId, isInitialRender, value = __value__) => {
|
||||
if (isInitialRender) {
|
||||
let componentCall = new TestBuilderChild(parent ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormFirst.ets", line: 37, col: 7 });
|
||||
let componentCall = new TestBuilderChild(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormFirst.ets", line: 37, col: 7 });
|
||||
ViewPU.create(componentCall);
|
||||
let paramsLambda = () => {
|
||||
return {};
|
||||
|
@ -160,7 +160,7 @@ function testInnerComponent(value, parent = null) {
|
||||
{
|
||||
(parent ? parent : this).observeComponentCreation2((elmtId, isInitialRender, value = __value__) => {
|
||||
if (isInitialRender) {
|
||||
let componentCall = new TestBuilderChild(parent ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormSecond.ets", line: 40, col: 5 });
|
||||
let componentCall = new TestBuilderChild(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormSecond.ets", line: 40, col: 5 });
|
||||
ViewPU.create(componentCall);
|
||||
let paramsLambda = () => {
|
||||
return {};
|
||||
@ -179,7 +179,7 @@ function testInnerComponent(value, parent = null) {
|
||||
{
|
||||
(parent ? parent : this).observeComponentCreation2((elmtId, isInitialRender, value = __value__) => {
|
||||
if (isInitialRender) {
|
||||
let componentCall = new TestBuilderChild(parent ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormSecond.ets", line: 41, col: 5 });
|
||||
let componentCall = new TestBuilderChild(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormSecond.ets", line: 41, col: 5 });
|
||||
ViewPU.create(componentCall);
|
||||
let paramsLambda = () => {
|
||||
return {};
|
||||
|
@ -160,7 +160,7 @@ function testInnerComponent(value, parent = null) {
|
||||
(parent ? parent : this).observeRecycleComponentCreation("TestBuilderReusable", (elmtId, isInitialRender, recycleNode = null) => {
|
||||
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
|
||||
if (isInitialRender) {
|
||||
let componentCall = recycleNode ? recycleNode : new TestBuilderReusable(parent ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormThird.ets", line: 38, col: 5 });
|
||||
let componentCall = recycleNode ? recycleNode : new TestBuilderReusable(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormThird.ets", line: 38, col: 5 });
|
||||
ViewPU.createRecycle(componentCall, recycleNode !== null, "TestBuilderReusable", () => {
|
||||
if (recycleNode && typeof recycleNode.aboutToReuseInternal === "function") {
|
||||
recycleNode.aboutToReuseInternal();
|
||||
@ -195,7 +195,7 @@ function testInnerComponent(value, parent = null) {
|
||||
(parent ? parent : this).observeRecycleComponentCreation("TestBuilderReusable", (elmtId, isInitialRender, recycleNode = null) => {
|
||||
ViewStackProcessor.StartGetAccessRecordingFor(elmtId);
|
||||
if (isInitialRender) {
|
||||
let componentCall = recycleNode ? recycleNode : new TestBuilderReusable(parent ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormThird.ets", line: 39, col: 5 });
|
||||
let componentCall = recycleNode ? recycleNode : new TestBuilderReusable(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderTransFormThird.ets", line: 39, col: 5 });
|
||||
ViewPU.createRecycle(componentCall, recycleNode !== null, "TestBuilderReusable", () => {
|
||||
if (recycleNode && typeof recycleNode.aboutToReuseInternal === "function") {
|
||||
recycleNode.aboutToReuseInternal();
|
||||
|
@ -75,7 +75,7 @@ function comp($$, parent = null) {
|
||||
{
|
||||
(parent ? parent : this).observeComponentCreation2((elmtId, isInitialRender, $$ = __$$__) => {
|
||||
if (isInitialRender) {
|
||||
let componentCall = new Child(parent ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderVisilibity$$.ets", line: 11, col: 5 });
|
||||
let componentCall = new Child(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderVisilibity$$.ets", line: 11, col: 5 });
|
||||
ViewPU.create(componentCall);
|
||||
let paramsLambda = () => {
|
||||
return {};
|
||||
|
@ -51,7 +51,7 @@ function myBuilder(parent = null) {
|
||||
{
|
||||
(parent ? parent : this).observeComponentCreation2((elmtId, isInitialRender) => {
|
||||
if (isInitialRender) {
|
||||
let componentCall = new child(parent ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderWithComponent.ets", line: 4, col: 3 });
|
||||
let componentCall = new child(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderWithComponent.ets", line: 4, col: 3 });
|
||||
ViewPU.create(componentCall);
|
||||
let paramsLambda = () => {
|
||||
return {};
|
||||
@ -87,7 +87,7 @@ class Index extends ViewPU {
|
||||
{
|
||||
this.observeComponentCreation2((elmtId, isInitialRender) => {
|
||||
if (isInitialRender) {
|
||||
let componentCall = new child(parent ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderWithComponent.ets", line: 11, col: 5 });
|
||||
let componentCall = new child(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderWithComponent.ets", line: 11, col: 5 });
|
||||
ViewPU.create(componentCall);
|
||||
let paramsLambda = () => {
|
||||
return {};
|
||||
|
@ -61,7 +61,7 @@ function ComB(param, parent = null) {
|
||||
{
|
||||
(parent ? parent : this).observeComponentCreation2((elmtId, isInitialRender, param = __param__) => {
|
||||
if (isInitialRender) {
|
||||
let componentCall = new ComA(parent ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderWithForEach.ets", line: 5, col: 5 });
|
||||
let componentCall = new ComA(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, {}, undefined, elmtId, () => { }, { page: "@builderWithForEach.ets", line: 5, col: 5 });
|
||||
ViewPU.create(componentCall);
|
||||
let paramsLambda = () => {
|
||||
return {};
|
||||
|
@ -115,7 +115,7 @@ class TestPage extends ViewPU {
|
||||
{
|
||||
this.observeComponentCreation2((elmtId, isInitialRender) => {
|
||||
if (isInitialRender) {
|
||||
let componentCall = new TitleComp(parent ? parent : this, { title: this.__value }, undefined, elmtId, () => { }, { page: "@builderWithLinkData.ets", line: 16, col: 5 });
|
||||
let componentCall = new TitleComp(typeof PUV2ViewBase !== "undefined" && parent instanceof PUV2ViewBase ? parent : this, { title: this.__value }, undefined, elmtId, () => { }, { page: "@builderWithLinkData.ets", line: 16, col: 5 });
|
||||
ViewPU.create(componentCall);
|
||||
let paramsLambda = () => {
|
||||
return {
|
||||
|
Loading…
Reference in New Issue
Block a user