From 80c16526fbeac4e9fc93e99e5292321d6fc40a37 Mon Sep 17 00:00:00 2001 From: Dunqing <29533304+Dunqing@users.noreply.github.com> Date: Tue, 31 Dec 2024 12:30:57 +0000 Subject: [PATCH] chore(transformer): enable Babel's private-property-in-property plugin tests (#8201) --- .../snapshots/babel.snap.md | 181 +++++++++++++++++- .../snapshots/babel_exec.snap.md | 38 +++- tasks/transform_conformance/src/constants.rs | 2 +- 3 files changed, 218 insertions(+), 3 deletions(-) diff --git a/tasks/transform_conformance/snapshots/babel.snap.md b/tasks/transform_conformance/snapshots/babel.snap.md index b4a40c25f239b..a06191d8711f4 100644 --- a/tasks/transform_conformance/snapshots/babel.snap.md +++ b/tasks/transform_conformance/snapshots/babel.snap.md @@ -1,6 +1,6 @@ commit: 54a8389f -Passed: 661/1095 +Passed: 661/1154 # All Passed: * babel-plugin-transform-logical-assignment-operators @@ -811,6 +811,185 @@ x Output mismatch x Output mismatch +# babel-plugin-transform-private-property-in-object (0/59) +* assumption-privateFieldsAsProperties/accessor/input.js +x Output mismatch + +* assumption-privateFieldsAsProperties/compiled-classes/input.js +x Output mismatch + +* assumption-privateFieldsAsProperties/field/input.js +x Output mismatch + +* assumption-privateFieldsAsProperties/method/input.js +x Output mismatch + +* assumption-privateFieldsAsProperties/nested-class/input.js +x Output mismatch + +* assumption-privateFieldsAsProperties/nested-class-other-redeclared/input.js +x Output mismatch + +* assumption-privateFieldsAsProperties/nested-class-redeclared/input.js +x Output mismatch + +* assumption-privateFieldsAsProperties/static-accessor/input.js +x Output mismatch + +* assumption-privateFieldsAsProperties/static-field/input.js +x Output mismatch + +* assumption-privateFieldsAsProperties/static-method/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/accessor/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/compiled-classes/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/field/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/method/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/nested-class/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/nested-class-other-redeclared/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/nested-class-redeclared/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/static-accessor/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/static-field/input.js +x Output mismatch + +* assumption-privateFieldsAsSymbols/static-method/input.js +x Output mismatch + +* private/accessor/input.js +x Output mismatch + +* private/field/input.js +x Output mismatch + +* private/method/input.js +x Output mismatch + +* private/native-classes/input.js +x Output mismatch + +* private/nested-class/input.js +x Output mismatch + +* private/nested-class-other-redeclared/input.js +x Output mismatch + +* private/nested-class-redeclared/input.js +x Output mismatch + +* private/static-accessor/input.js +x Output mismatch + +* private/static-field/input.js +x Output mismatch + +* private/static-method/input.js +x Output mismatch + +* private/static-shadow/input.js +x Output mismatch + +* private-loose/accessor/input.js +x Output mismatch + +* private-loose/field/input.js +x Output mismatch + +* private-loose/method/input.js +x Output mismatch + +* private-loose/native-classes/input.js +x Output mismatch + +* private-loose/nested-class/input.js +x Output mismatch + +* private-loose/nested-class-other-redeclared/input.js +x Output mismatch + +* private-loose/nested-class-redeclared/input.js +x Output mismatch + +* private-loose/static-accessor/input.js +x Output mismatch + +* private-loose/static-field/input.js +x Output mismatch + +* private-loose/static-method/input.js +x Output mismatch + +* private-loose/static-shadow/input.js +x Output mismatch + +* to-native-fields/accessor/input.js +x Output mismatch + +* to-native-fields/class-expression-in-default-param/input.js +x Output mismatch + +* to-native-fields/class-expression-instance/input.js +x Output mismatch + +* to-native-fields/class-expression-static/input.js +x Output mismatch + +* to-native-fields/field/input.js +x Output mismatch + +* to-native-fields/half-constructed-instance/input.js +x Output mismatch + +* to-native-fields/half-constructed-static/input.js +x Output mismatch + +* to-native-fields/method/input.js +x Output mismatch + +* to-native-fields/multiple-checks/input.js +x Output mismatch + +* to-native-fields/nested-class/input.js +x Output mismatch + +* to-native-fields/nested-class-other-redeclared/input.js +x Output mismatch + +* to-native-fields/nested-class-redeclared/input.js +x Output mismatch + +* to-native-fields/static-accessor/input.js +x Output mismatch + +* to-native-fields/static-field/input.js +x Output mismatch + +* to-native-fields/static-method/input.js +x Output mismatch + +* to-native-fields/static-shadow/input.js +x Output mismatch + +* to-native-fields/static-shadowed-binding/input.js +x Output mismatch + + # babel-plugin-transform-nullish-coalescing-operator (5/12) * assumption-noDocumentAll/transform/input.js x Output mismatch diff --git a/tasks/transform_conformance/snapshots/babel_exec.snap.md b/tasks/transform_conformance/snapshots/babel_exec.snap.md index 4d20a86052c35..bbd5785280a7b 100644 --- a/tasks/transform_conformance/snapshots/babel_exec.snap.md +++ b/tasks/transform_conformance/snapshots/babel_exec.snap.md @@ -2,7 +2,7 @@ commit: 54a8389f node: v22.12.0 -Passed: 283 of 362 (78.18%) +Passed: 283 of 374 (75.67%) Failures: @@ -414,6 +414,42 @@ TypeError: "#privateStaticFieldValue" is write-only at Function.getPrivateStaticFieldValue (./tasks/transform_conformance/fixtures/babel/babel-plugin-transform-private-methods-test-fixtures-static-accessors-privateFieldsAsSymbols-get-only-setter-exec.test.js:7:15) at ./tasks/transform_conformance/fixtures/babel/babel-plugin-transform-private-methods-test-fixtures-static-accessors-privateFieldsAsSymbols-get-only-setter-exec.test.js:14:12 +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-assumption-privateFieldsAsProperties-method-exec.test.js +Private field '#foo' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-assumption-privateFieldsAsProperties-rhs-not-object-exec.test.js +Private field '#p' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-assumption-privateFieldsAsSymbols-method-exec.test.js +Private field '#foo' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-assumption-privateFieldsAsSymbols-rhs-not-object-exec.test.js +Private field '#p' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-private-loose-rhs-not-object-exec.test.js +Private field '#p' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-private-loose-static-shadow-exec.test.js +Private field '#x' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-private-rhs-not-object-exec.test.js +Private field '#p' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-private-static-shadow-exec.test.js +Private field '#x' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-to-native-fields-half-constructed-instance-exec.test.js +Private field '#w' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-to-native-fields-half-constructed-static-exec.test.js +Private field '#w' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-to-native-fields-rhs-not-object-exec.test.js +Private field '#p' must be declared in an enclosing class + +./fixtures/babel/babel-plugin-transform-private-property-in-object-test-fixtures-to-native-fields-static-shadow-exec.test.js +Private field '#x' must be declared in an enclosing class + ./fixtures/babel/babel-preset-env-test-fixtures-plugins-integration-issue-15170-exec.test.js AssertionError: expected [Function] to not throw an error but 'ReferenceError: x is not defined' was thrown at Proxy. (./node_modules/.pnpm/@vitest+expect@2.1.2/node_modules/@vitest/expect/dist/index.js:1438:21) diff --git a/tasks/transform_conformance/src/constants.rs b/tasks/transform_conformance/src/constants.rs index 0e847e2e09fc3..9f3eacdc34582 100644 --- a/tasks/transform_conformance/src/constants.rs +++ b/tasks/transform_conformance/src/constants.rs @@ -6,7 +6,7 @@ pub const PLUGINS: &[&str] = &[ "babel-plugin-transform-class-properties", "babel-plugin-transform-class-static-block", "babel-plugin-transform-private-methods", - // "babel-plugin-transform-private-property-in-object", + "babel-plugin-transform-private-property-in-object", // // [Syntax] "babel-plugin-transform-syntax-top-level-await", // ES2021 "babel-plugin-transform-logical-assignment-operators",