From 2b9f64065882c07531c13d841a84c68ff79e2b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Thu, 14 Jul 2022 16:19:46 -0400 Subject: [PATCH] update Babel 8 testcases --- .../handle-spread-with-proto-babel-7/input.js | 7 +++++++ .../options.json | 3 +++ .../handle-spread-with-proto-babel-7/output.js | 18 ++++++++++++++++++ .../react/handle-spread-with-proto/output.js | 11 ++++++----- 4 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/input.js create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/options.json create mode 100644 packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/output.js diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/input.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/input.js new file mode 100644 index 000000000000..9c912e5b5dac --- /dev/null +++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/input.js @@ -0,0 +1,7 @@ +var __proto__ = null; + +

text

; + +
{contents}
; + +; diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/options.json b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/options.json new file mode 100644 index 000000000000..29a3f0e84167 --- /dev/null +++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/options.json @@ -0,0 +1,3 @@ +{ + "BABEL_8_BREAKING": false +} diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/output.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/output.js new file mode 100644 index 000000000000..456dad6b23ff --- /dev/null +++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto-babel-7/output.js @@ -0,0 +1,18 @@ +var __proto__ = null; + +/*#__PURE__*/ +React.createElement("p", { + __proto__: null +}, "text"); + +/*#__PURE__*/ +React.createElement("div", { + "__proto__": null +}, contents); + +/*#__PURE__*/ +React.createElement("img", babelHelpers.extends({ + alt: "" +}, { + __proto__ +})); diff --git a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto/output.js b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto/output.js index 456dad6b23ff..8cbd2578a629 100644 --- a/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto/output.js +++ b/packages/babel-plugin-transform-react-jsx/test/fixtures/react/handle-spread-with-proto/output.js @@ -11,8 +11,9 @@ React.createElement("div", { }, contents); /*#__PURE__*/ -React.createElement("img", babelHelpers.extends({ - alt: "" -}, { - __proto__ -})); +React.createElement("img", { + alt: "", + ...{ + __proto__ + } +});