mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Backed out changeset 5656e43f9b43 (bug 1560006) for debugger test fails at SourcesTreeItem.spec.js
--HG-- extra : rebase_source : bb5081c6c4b2e735f41745bf047a39404cd1e6e4
This commit is contained in:
parent
2c4d0c79fb
commit
e639b0bebd
@ -68,9 +68,9 @@
|
||||
"parse-script-tags": "^0.1.6",
|
||||
"pretty-fast": "^0.2.3",
|
||||
"prop-types": "^15.6.0",
|
||||
"react": "16.8.6",
|
||||
"react": "16.4.1",
|
||||
"react-aria-components": "^0.0.4",
|
||||
"react-dom": "16.8.6",
|
||||
"react-dom": "16.4.1",
|
||||
"react-redux": "^5.0.7",
|
||||
"react-transition-group": "^2.2.1",
|
||||
"reselect": "^4.0.0",
|
||||
@ -111,9 +111,9 @@
|
||||
"copy-paste": "^1.3.0",
|
||||
"copy-webpack-plugin": "^4.5.2",
|
||||
"devtools-license-check": "^0.7.0",
|
||||
"enzyme": "^3.10.0",
|
||||
"enzyme-adapter-react-16": "^1.14.0",
|
||||
"enzyme-to-json": "3.3.5",
|
||||
"enzyme": "^3.3.0",
|
||||
"enzyme-adapter-react-16": "^1.1.1",
|
||||
"enzyme-to-json": "3.3.4",
|
||||
"eslint": "^5.0.0",
|
||||
"eslint-config-prettier": "^4.0.0",
|
||||
"eslint-plugin-babel": "^5.0.0",
|
||||
|
@ -544,22 +544,6 @@ airbnb-js-shims@^1.4.1:
|
||||
string.prototype.padstart "^3.0.0"
|
||||
symbol.prototype.description "^1.0.0"
|
||||
|
||||
airbnb-prop-types@^2.13.2:
|
||||
version "2.13.2"
|
||||
resolved "https://registry.yarnpkg.com/airbnb-prop-types/-/airbnb-prop-types-2.13.2.tgz#43147a5062dd2a4a5600e748a47b64004cc5f7fc"
|
||||
integrity sha512-2FN6DlHr6JCSxPPi25EnqGaXC4OC3/B3k1lCd6MMYrZ51/Gf/1qDfaR+JElzWa+Tl7cY2aYOlsYJGFeQyVHIeQ==
|
||||
dependencies:
|
||||
array.prototype.find "^2.0.4"
|
||||
function.prototype.name "^1.1.0"
|
||||
has "^1.0.3"
|
||||
is-regex "^1.0.4"
|
||||
object-is "^1.0.1"
|
||||
object.assign "^4.1.0"
|
||||
object.entries "^1.1.0"
|
||||
prop-types "^15.7.2"
|
||||
prop-types-exact "^1.2.0"
|
||||
react-is "^16.8.6"
|
||||
|
||||
ajv-keywords@^1.1.1:
|
||||
version "1.5.1"
|
||||
resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-1.5.1.tgz#314dd0a4b3368fad3dfcdc54ede6171b886daf3c"
|
||||
@ -734,11 +718,6 @@ array-equal@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93"
|
||||
|
||||
array-filter@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-1.0.0.tgz#baf79e62e6ef4c2a4c0b831232daffec251f9d83"
|
||||
integrity sha1-uveeYubvTCpMC4MSMtr/7CUfnYM=
|
||||
|
||||
array-filter@~0.0.0:
|
||||
version "0.0.1"
|
||||
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
|
||||
@ -792,14 +771,6 @@ array-unique@^0.3.2:
|
||||
version "0.3.2"
|
||||
resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
|
||||
|
||||
array.prototype.find@^2.0.4:
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/array.prototype.find/-/array.prototype.find-2.1.0.tgz#630f2eaf70a39e608ac3573e45cf8ccd0ede9ad7"
|
||||
integrity sha512-Wn41+K1yuO5p7wRZDl7890c3xvv5UBrfVXTVIe28rSQb6LS0fZMDrQB6PAcxQFRFy6vJTLDc3A2+3CjQdzVKRg==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.13.0"
|
||||
|
||||
array.prototype.flat@^1.2.1:
|
||||
version "1.2.1"
|
||||
resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.2.1.tgz#812db8f02cad24d3fab65dd67eabe3b8903494a4"
|
||||
@ -3194,13 +3165,6 @@ define-properties@^1.1.2:
|
||||
foreach "^2.0.5"
|
||||
object-keys "^1.0.8"
|
||||
|
||||
define-properties@^1.1.3:
|
||||
version "1.1.3"
|
||||
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.3.tgz#cf88da6cbee26fe6db7094f61d870cbd84cee9f1"
|
||||
integrity sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==
|
||||
dependencies:
|
||||
object-keys "^1.0.12"
|
||||
|
||||
define-property@^0.2.5:
|
||||
version "0.2.5"
|
||||
resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116"
|
||||
@ -3719,32 +3683,6 @@ enzyme-adapter-react-16@^1.1.1:
|
||||
react-reconciler "^0.7.0"
|
||||
react-test-renderer "^16.0.0-0"
|
||||
|
||||
enzyme-adapter-react-16@^1.14.0:
|
||||
version "1.14.0"
|
||||
resolved "https://registry.yarnpkg.com/enzyme-adapter-react-16/-/enzyme-adapter-react-16-1.14.0.tgz#204722b769172bcf096cb250d33e6795c1f1858f"
|
||||
integrity sha512-7PcOF7pb4hJUvjY7oAuPGpq3BmlCig3kxXGi2kFx0YzJHppqX1K8IIV9skT1IirxXlu8W7bneKi+oQ10QRnhcA==
|
||||
dependencies:
|
||||
enzyme-adapter-utils "^1.12.0"
|
||||
has "^1.0.3"
|
||||
object.assign "^4.1.0"
|
||||
object.values "^1.1.0"
|
||||
prop-types "^15.7.2"
|
||||
react-is "^16.8.6"
|
||||
react-test-renderer "^16.0.0-0"
|
||||
semver "^5.7.0"
|
||||
|
||||
enzyme-adapter-utils@^1.12.0:
|
||||
version "1.12.0"
|
||||
resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.12.0.tgz#96e3730d76b872f593e54ce1c51fa3a451422d93"
|
||||
integrity sha512-wkZvE0VxcFx/8ZsBw0iAbk3gR1d9hK447ebnSYBf95+r32ezBq+XDSAvRErkc4LZosgH8J7et7H7/7CtUuQfBA==
|
||||
dependencies:
|
||||
airbnb-prop-types "^2.13.2"
|
||||
function.prototype.name "^1.1.0"
|
||||
object.assign "^4.1.0"
|
||||
object.fromentries "^2.0.0"
|
||||
prop-types "^15.7.2"
|
||||
semver "^5.6.0"
|
||||
|
||||
enzyme-adapter-utils@^1.3.0:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/enzyme-adapter-utils/-/enzyme-adapter-utils-1.4.0.tgz#c403b81e8eb9953658569e539780964bdc98de62"
|
||||
@ -3752,46 +3690,12 @@ enzyme-adapter-utils@^1.3.0:
|
||||
object.assign "^4.1.0"
|
||||
prop-types "^15.6.0"
|
||||
|
||||
enzyme-to-json@3.3.5:
|
||||
version "3.3.5"
|
||||
resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.3.5.tgz#f8eb82bd3d5941c9d8bc6fd9140030777d17d0af"
|
||||
integrity sha512-DmH1wJ68HyPqKSYXdQqB33ZotwfUhwQZW3IGXaNXgR69Iodaoj8TF/D9RjLdz4pEhGq2Tx2zwNUIjBuqoZeTgA==
|
||||
dependencies:
|
||||
lodash "^4.17.4"
|
||||
|
||||
enzyme-to-json@^3.3.1:
|
||||
enzyme-to-json@3.3.4, enzyme-to-json@^3.3.1:
|
||||
version "3.3.4"
|
||||
resolved "https://registry.yarnpkg.com/enzyme-to-json/-/enzyme-to-json-3.3.4.tgz#67c6040e931182f183418af2eb9f4323258aa77f"
|
||||
dependencies:
|
||||
lodash "^4.17.4"
|
||||
|
||||
enzyme@^3.10.0:
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.10.0.tgz#7218e347c4a7746e133f8e964aada4a3523452f6"
|
||||
integrity sha512-p2yy9Y7t/PFbPoTvrWde7JIYB2ZyGC+NgTNbVEGvZ5/EyoYSr9aG/2rSbVvyNvMHEhw9/dmGUJHWtfQIEiX9pg==
|
||||
dependencies:
|
||||
array.prototype.flat "^1.2.1"
|
||||
cheerio "^1.0.0-rc.2"
|
||||
function.prototype.name "^1.1.0"
|
||||
has "^1.0.3"
|
||||
html-element-map "^1.0.0"
|
||||
is-boolean-object "^1.0.0"
|
||||
is-callable "^1.1.4"
|
||||
is-number-object "^1.0.3"
|
||||
is-regex "^1.0.4"
|
||||
is-string "^1.0.4"
|
||||
is-subset "^0.1.1"
|
||||
lodash.escape "^4.0.1"
|
||||
lodash.isequal "^4.5.0"
|
||||
object-inspect "^1.6.0"
|
||||
object-is "^1.0.1"
|
||||
object.assign "^4.1.0"
|
||||
object.entries "^1.0.4"
|
||||
object.values "^1.0.4"
|
||||
raf "^3.4.0"
|
||||
rst-selector-parser "^2.2.3"
|
||||
string.prototype.trim "^1.1.2"
|
||||
|
||||
enzyme@^3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/enzyme/-/enzyme-3.3.0.tgz#0971abd167f2d4bf3f5bd508229e1c4b6dc50479"
|
||||
@ -3835,18 +3739,6 @@ es-abstract@^1.10.0, es-abstract@^1.11.0, es-abstract@^1.12.0, es-abstract@^1.4.
|
||||
is-callable "^1.1.3"
|
||||
is-regex "^1.0.4"
|
||||
|
||||
es-abstract@^1.13.0, es-abstract@^1.5.0:
|
||||
version "1.13.0"
|
||||
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.13.0.tgz#ac86145fdd5099d8dd49558ccba2eaf9b88e24e9"
|
||||
integrity sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==
|
||||
dependencies:
|
||||
es-to-primitive "^1.2.0"
|
||||
function-bind "^1.1.1"
|
||||
has "^1.0.3"
|
||||
is-callable "^1.1.4"
|
||||
is-regex "^1.0.4"
|
||||
object-keys "^1.0.12"
|
||||
|
||||
es-to-primitive@^1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d"
|
||||
@ -3855,15 +3747,6 @@ es-to-primitive@^1.1.1:
|
||||
is-date-object "^1.0.1"
|
||||
is-symbol "^1.0.1"
|
||||
|
||||
es-to-primitive@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.0.tgz#edf72478033456e8dda8ef09e00ad9650707f377"
|
||||
integrity sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==
|
||||
dependencies:
|
||||
is-callable "^1.1.4"
|
||||
is-date-object "^1.0.1"
|
||||
is-symbol "^1.0.2"
|
||||
|
||||
es5-ext@^0.10.14, es5-ext@^0.10.35, es5-ext@^0.10.9, es5-ext@~0.10.14:
|
||||
version "0.10.45"
|
||||
resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.45.tgz#0bfdf7b473da5919d5adf3bd25ceb754fccc3653"
|
||||
@ -5409,13 +5292,6 @@ html-element-attributes@^1.0.0:
|
||||
version "1.3.1"
|
||||
resolved "https://registry.yarnpkg.com/html-element-attributes/-/html-element-attributes-1.3.1.tgz#9fa6a2e37e6b61790a303e87ddbbb9746e8c035f"
|
||||
|
||||
html-element-map@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/html-element-map/-/html-element-map-1.0.1.tgz#3c4fcb4874ebddfe4283b51c8994e7713782b592"
|
||||
integrity sha512-BZSfdEm6n706/lBfXKWa4frZRZcT5k1cOusw95ijZsHlI+GdgY0v95h6IzO3iIDf2ROwq570YTwqNPqHcNMozw==
|
||||
dependencies:
|
||||
array-filter "^1.0.0"
|
||||
|
||||
html-encoding-sniffer@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8"
|
||||
@ -5831,7 +5707,7 @@ is-builtin-module@^1.0.0:
|
||||
dependencies:
|
||||
builtin-modules "^1.0.0"
|
||||
|
||||
is-callable@^1.1.1, is-callable@^1.1.3, is-callable@^1.1.4:
|
||||
is-callable@^1.1.1, is-callable@^1.1.3:
|
||||
version "1.1.4"
|
||||
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75"
|
||||
|
||||
@ -6103,13 +5979,6 @@ is-symbol@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572"
|
||||
|
||||
is-symbol@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.2.tgz#a055f6ae57192caee329e7a860118b497a950f38"
|
||||
integrity sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==
|
||||
dependencies:
|
||||
has-symbols "^1.0.0"
|
||||
|
||||
is-typedarray@~1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
|
||||
@ -7095,11 +6964,6 @@ lodash.debounce@^4.0.8:
|
||||
version "4.0.8"
|
||||
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
|
||||
|
||||
lodash.escape@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/lodash.escape/-/lodash.escape-4.0.1.tgz#c9044690c21e04294beaa517712fded1fa88de98"
|
||||
integrity sha1-yQRGkMIeBClL6qUXcS/e0fqI3pg=
|
||||
|
||||
lodash.findkey@^4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.findkey/-/lodash.findkey-4.6.0.tgz#83058e903b51cbb759d09ccf546dea3ea39c4718"
|
||||
@ -7120,11 +6984,6 @@ lodash.isarray@^3.0.0:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
|
||||
|
||||
lodash.isequal@^4.5.0:
|
||||
version "4.5.0"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
|
||||
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=
|
||||
|
||||
lodash.isplainobject@^4.0.6:
|
||||
version "4.0.6"
|
||||
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
|
||||
@ -7222,7 +7081,7 @@ longest@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
|
||||
|
||||
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
|
||||
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
|
||||
dependencies:
|
||||
@ -8045,7 +7904,7 @@ object-filter@^1.0.2:
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/object-filter/-/object-filter-1.0.2.tgz#af0b797ffebeaf8a52c6637cedbe8816cfec1bc8"
|
||||
|
||||
object-inspect@^1.5.0, object-inspect@^1.6.0:
|
||||
object-inspect@^1.5.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.6.0.tgz#c70b6cbf72f274aab4c34c0c82f5167bf82cf15b"
|
||||
|
||||
@ -8057,11 +7916,6 @@ object-keys@^1.0.11, object-keys@^1.0.8:
|
||||
version "1.0.12"
|
||||
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.12.tgz#09c53855377575310cca62f55bb334abff7b3ed2"
|
||||
|
||||
object-keys@^1.0.12:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e"
|
||||
integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==
|
||||
|
||||
object-visit@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb"
|
||||
@ -8086,16 +7940,6 @@ object.entries@^1.0.4:
|
||||
function-bind "^1.1.0"
|
||||
has "^1.0.1"
|
||||
|
||||
object.entries@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519"
|
||||
integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.12.0"
|
||||
function-bind "^1.1.1"
|
||||
has "^1.0.3"
|
||||
|
||||
object.fromentries@^1.0.0:
|
||||
version "1.0.0"
|
||||
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-1.0.0.tgz#e90ec27445ec6e37f48be9af9077d9aa8bef0d40"
|
||||
@ -8105,16 +7949,6 @@ object.fromentries@^1.0.0:
|
||||
function-bind "^1.1.1"
|
||||
has "^1.0.1"
|
||||
|
||||
object.fromentries@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab"
|
||||
integrity sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==
|
||||
dependencies:
|
||||
define-properties "^1.1.2"
|
||||
es-abstract "^1.11.0"
|
||||
function-bind "^1.1.1"
|
||||
has "^1.0.1"
|
||||
|
||||
object.getownpropertydescriptors@^2.0.3:
|
||||
version "2.0.3"
|
||||
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
|
||||
@ -8144,16 +7978,6 @@ object.values@^1.0.4:
|
||||
function-bind "^1.1.0"
|
||||
has "^1.0.1"
|
||||
|
||||
object.values@^1.1.0:
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9"
|
||||
integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==
|
||||
dependencies:
|
||||
define-properties "^1.1.3"
|
||||
es-abstract "^1.12.0"
|
||||
function-bind "^1.1.1"
|
||||
has "^1.0.3"
|
||||
|
||||
on-finished@~2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947"
|
||||
@ -9023,15 +8847,6 @@ prompts@^0.1.9:
|
||||
kleur "^2.0.1"
|
||||
sisteransi "^0.1.1"
|
||||
|
||||
prop-types-exact@^1.2.0:
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/prop-types-exact/-/prop-types-exact-1.2.0.tgz#825d6be46094663848237e3925a98c6e944e9869"
|
||||
integrity sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA==
|
||||
dependencies:
|
||||
has "^1.0.3"
|
||||
object.assign "^4.1.0"
|
||||
reflect.ownkeys "^0.2.0"
|
||||
|
||||
prop-types@^15.5.0, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8, prop-types@^15.5.9, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2:
|
||||
version "15.6.2"
|
||||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.6.2.tgz#05d5ca77b4453e985d60fc7ff8c859094a497102"
|
||||
@ -9039,15 +8854,6 @@ prop-types@^15.5.0, prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.8,
|
||||
loose-envify "^1.3.1"
|
||||
object-assign "^4.1.1"
|
||||
|
||||
prop-types@^15.7.2:
|
||||
version "15.7.2"
|
||||
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
|
||||
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
|
||||
dependencies:
|
||||
loose-envify "^1.4.0"
|
||||
object-assign "^4.1.1"
|
||||
react-is "^16.8.1"
|
||||
|
||||
properties-parser@^0.3.1:
|
||||
version "0.3.1"
|
||||
resolved "https://registry.yarnpkg.com/properties-parser/-/properties-parser-0.3.1.tgz#1316e9539ffbfd93845e369b211022abd478771a"
|
||||
@ -9319,16 +9125,6 @@ react-dom@16.4.1, react-dom@^16.4.1:
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.0"
|
||||
|
||||
react-dom@16.8.6:
|
||||
version "16.8.6"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f"
|
||||
integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.2"
|
||||
scheduler "^0.13.6"
|
||||
|
||||
react-dom@^0.14.0:
|
||||
version "0.14.9"
|
||||
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-0.14.9.tgz#05064a3dcf0fb1880a3b2bfc9d58c55d8d9f6293"
|
||||
@ -9377,11 +9173,6 @@ react-is@^16.4.1:
|
||||
version "16.4.1"
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.4.1.tgz#d624c4650d2c65dbd52c72622bbf389435d9776e"
|
||||
|
||||
react-is@^16.8.1, react-is@^16.8.6:
|
||||
version "16.8.6"
|
||||
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
|
||||
integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==
|
||||
|
||||
react-lifecycles-compat@^3.0.0, react-lifecycles-compat@^3.0.4:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
|
||||
@ -9468,16 +9259,6 @@ react@16.4.1, react@^16.4.1:
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.0"
|
||||
|
||||
react@16.8.6:
|
||||
version "16.8.6"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
|
||||
integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
prop-types "^15.6.2"
|
||||
scheduler "^0.13.6"
|
||||
|
||||
react@^0.14.0:
|
||||
version "0.14.9"
|
||||
resolved "https://registry.yarnpkg.com/react/-/react-0.14.9.tgz#9110a6497c49d44ba1c0edd317aec29c2e0d91d1"
|
||||
@ -9723,11 +9504,6 @@ redux@^3.7.2:
|
||||
loose-envify "^1.1.0"
|
||||
symbol-observable "^1.0.3"
|
||||
|
||||
reflect.ownkeys@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"
|
||||
integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=
|
||||
|
||||
regenerate@^1.2.1:
|
||||
version "1.4.0"
|
||||
resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.0.tgz#4a856ec4b56e4077c557589cae85e7a4c8869a11"
|
||||
@ -10542,14 +10318,6 @@ sax@1.2.4, sax@>=0.6.0, sax@^1.2.4, sax@~1.2.1:
|
||||
version "1.2.4"
|
||||
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
|
||||
|
||||
scheduler@^0.13.6:
|
||||
version "0.13.6"
|
||||
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
|
||||
integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==
|
||||
dependencies:
|
||||
loose-envify "^1.1.0"
|
||||
object-assign "^4.1.1"
|
||||
|
||||
schema-utils@^0.3.0:
|
||||
version "0.3.0"
|
||||
resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-0.3.0.tgz#f5877222ce3e931edae039f17eb3716e7137f8cf"
|
||||
@ -10584,11 +10352,6 @@ semver@^5.5.1:
|
||||
version "5.6.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
|
||||
|
||||
semver@^5.6.0, semver@^5.7.0:
|
||||
version "5.7.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.0.tgz#790a7cf6fea5459bac96110b29b60412dc8ff96b"
|
||||
integrity sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==
|
||||
|
||||
send@0.16.2:
|
||||
version "0.16.2"
|
||||
resolved "https://registry.yarnpkg.com/send/-/send-0.16.2.tgz#6ecca1e0f8c156d141597559848df64730a6bbc1"
|
||||
@ -11075,15 +10838,6 @@ string.prototype.padstart@^3.0.0:
|
||||
es-abstract "^1.4.3"
|
||||
function-bind "^1.0.2"
|
||||
|
||||
string.prototype.trim@^1.1.2:
|
||||
version "1.1.2"
|
||||
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea"
|
||||
integrity sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=
|
||||
dependencies:
|
||||
define-properties "^1.1.2"
|
||||
es-abstract "^1.5.0"
|
||||
function-bind "^1.0.2"
|
||||
|
||||
string_decoder@^1.0.0, string_decoder@~1.1.1:
|
||||
version "1.1.1"
|
||||
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
|
||||
|
@ -22,7 +22,7 @@ NODE_ENV=production browserify index.js -t envify --standalone PropTypes -o reac
|
||||
## Copying files to your Firefox repo
|
||||
|
||||
```bash
|
||||
mv react-prop-types.js /firefox/repo/devtools/client/shared/vendor/react-prop-types.js
|
||||
mv react-prop-types.js /firefox/repo/devtools/client/shared/vendor/react-prop-types-dev.js
|
||||
mv react-prop-types-dev.js /firefox/repo/devtools/client/shared/vendor/react-prop-types-dev.js
|
||||
```
|
||||
|
||||
|
@ -17,7 +17,7 @@ You should start by upgrading our prop-types library to match the latest version
|
||||
```bash
|
||||
git clone https://github.com/facebook/react.git
|
||||
cd react
|
||||
git checkout v16.8.6 # or the version you are targetting
|
||||
git checkout v16.4.1 # or the version you are targetting
|
||||
```
|
||||
|
||||
## Preparing to Build
|
||||
|
2034
devtools/client/shared/vendor/react-dev.js
vendored
2034
devtools/client/shared/vendor/react-dev.js
vendored
File diff suppressed because it is too large
Load Diff
12013
devtools/client/shared/vendor/react-dom-dev.js
vendored
12013
devtools/client/shared/vendor/react-dom-dev.js
vendored
File diff suppressed because it is too large
Load Diff
1802
devtools/client/shared/vendor/react-dom-server-dev.js
vendored
1802
devtools/client/shared/vendor/react-dom-server-dev.js
vendored
File diff suppressed because it is too large
Load Diff
1104
devtools/client/shared/vendor/react-dom-server.js
vendored
1104
devtools/client/shared/vendor/react-dom-server.js
vendored
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
/** @license React v16.8.6
|
||||
/** @license React v16.4.1
|
||||
* react-dom-test-utils.development.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
@ -19,6 +19,16 @@ var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
var _assign = ReactInternals.assign;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Use invariant() to assert state which your program assumes to be true.
|
||||
*
|
||||
@ -30,10 +40,10 @@ var _assign = ReactInternals.assign;
|
||||
* will remain to ensure logic does not differ in production.
|
||||
*/
|
||||
|
||||
var validateFormat = function () {};
|
||||
var validateFormat = function validateFormat(format) {};
|
||||
|
||||
{
|
||||
validateFormat = function (format) {
|
||||
validateFormat = function validateFormat(format) {
|
||||
if (format === undefined) {
|
||||
throw new Error('invariant requires an error message argument');
|
||||
}
|
||||
@ -44,7 +54,7 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
||||
validateFormat(format);
|
||||
|
||||
if (!condition) {
|
||||
var error = void 0;
|
||||
var error;
|
||||
if (format === undefined) {
|
||||
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
||||
} else {
|
||||
@ -61,8 +71,57 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
||||
}
|
||||
}
|
||||
|
||||
var invariant_1 = invariant;
|
||||
|
||||
// Relying on the `invariant()` implementation lets us
|
||||
// preserve the format and params in the www builds.
|
||||
// have preserve the format and params in the www builds.
|
||||
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
function makeEmptyFunction(arg) {
|
||||
return function () {
|
||||
return arg;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* This function accepts and discards inputs; it has no side effects. This is
|
||||
* primarily useful idiomatically for overridable function endpoints which
|
||||
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
||||
*/
|
||||
var emptyFunction = function emptyFunction() {};
|
||||
|
||||
emptyFunction.thatReturns = makeEmptyFunction;
|
||||
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
||||
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
||||
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
||||
emptyFunction.thatReturnsThis = function () {
|
||||
return this;
|
||||
};
|
||||
emptyFunction.thatReturnsArgument = function (arg) {
|
||||
return arg;
|
||||
};
|
||||
|
||||
var emptyFunction_1 = emptyFunction;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Similar to invariant but only logs a warning if the condition is not met.
|
||||
@ -71,48 +130,49 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
||||
* same logic and follow the same code paths.
|
||||
*/
|
||||
|
||||
var warningWithoutStack = function () {};
|
||||
var warning = emptyFunction_1;
|
||||
|
||||
{
|
||||
warningWithoutStack = function (condition, format) {
|
||||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
||||
args[_key - 2] = arguments[_key];
|
||||
var printWarning = function printWarning(format) {
|
||||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
if (format === undefined) {
|
||||
throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
|
||||
}
|
||||
if (args.length > 8) {
|
||||
// Check before the condition to catch violations early.
|
||||
throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
|
||||
}
|
||||
if (condition) {
|
||||
return;
|
||||
}
|
||||
var argIndex = 0;
|
||||
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
||||
return args[argIndex++];
|
||||
});
|
||||
if (typeof console !== 'undefined') {
|
||||
var argsWithFormat = args.map(function (item) {
|
||||
return '' + item;
|
||||
});
|
||||
argsWithFormat.unshift('Warning: ' + format);
|
||||
|
||||
// We intentionally don't use spread (or .apply) directly because it
|
||||
// breaks IE9: https://github.com/facebook/react/issues/13610
|
||||
Function.prototype.apply.call(console.error, console, argsWithFormat);
|
||||
console.error(message);
|
||||
}
|
||||
try {
|
||||
// --- Welcome to debugging React ---
|
||||
// This error was thrown as a convenience so that you can use this stack
|
||||
// to find the callsite that caused this warning to fire.
|
||||
var argIndex = 0;
|
||||
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
||||
return args[argIndex++];
|
||||
});
|
||||
throw new Error(message);
|
||||
} catch (x) {}
|
||||
};
|
||||
|
||||
warning = function warning(condition, format) {
|
||||
if (format === undefined) {
|
||||
throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
|
||||
}
|
||||
|
||||
if (format.indexOf('Failed Composite propType: ') === 0) {
|
||||
return; // Ignore CompositeComponent proptype check.
|
||||
}
|
||||
|
||||
if (!condition) {
|
||||
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
||||
args[_key2 - 2] = arguments[_key2];
|
||||
}
|
||||
|
||||
printWarning.apply(undefined, [format].concat(args));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var warningWithoutStack$1 = warningWithoutStack;
|
||||
var warning_1 = warning;
|
||||
|
||||
/**
|
||||
* `ReactInstanceMap` maintains a mapping from a public facing stateful
|
||||
@ -135,23 +195,17 @@ function get(key) {
|
||||
return key._reactInternalFiber;
|
||||
}
|
||||
|
||||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
var ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
// Prevent newer renderers from RTE when used with older react package versions.
|
||||
// Current owner and dispatcher used to share the same ref,
|
||||
// but PR #14548 split them out to better support the react-debug-tools package.
|
||||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
||||
ReactSharedInternals.ReactCurrentDispatcher = {
|
||||
current: null
|
||||
};
|
||||
}
|
||||
var ReactCurrentOwner = ReactInternals$1.ReactCurrentOwner;
|
||||
var ReactDebugCurrentFrame = ReactInternals$1.ReactDebugCurrentFrame;
|
||||
|
||||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
||||
// nor polyfill, then a plain number is used for performance.
|
||||
|
||||
var FunctionComponent = 0;
|
||||
var ClassComponent = 1;
|
||||
// Before we know whether it is function or class
|
||||
// Before we know whether it is functional or class
|
||||
var FunctionalComponent = 1;
|
||||
var ClassComponent = 2;
|
||||
var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
|
||||
// A subtree. Could be an entry point to a different renderer.
|
||||
var HostComponent = 5;
|
||||
@ -172,14 +226,8 @@ var Placement = /* */2;
|
||||
|
||||
|
||||
|
||||
|
||||
// Passive & Update & Callback & Ref & Snapshot
|
||||
|
||||
|
||||
// Union of all host effects
|
||||
|
||||
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
||||
|
||||
var MOUNTING = 1;
|
||||
var MOUNTED = 2;
|
||||
var UNMOUNTED = 3;
|
||||
@ -218,7 +266,7 @@ function isFiberMountedImpl(fiber) {
|
||||
|
||||
|
||||
function assertIsMounted(fiber) {
|
||||
!(isFiberMountedImpl(fiber) === MOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
|
||||
!(isFiberMountedImpl(fiber) === MOUNTED) ? invariant_1(false, 'Unable to find node on an unmounted component.') : void 0;
|
||||
}
|
||||
|
||||
function findCurrentFiberUsingSlowPath(fiber) {
|
||||
@ -226,7 +274,7 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
||||
if (!alternate) {
|
||||
// If there is no alternate, then we only need to check if it is mounted.
|
||||
var state = isFiberMountedImpl(fiber);
|
||||
!(state !== UNMOUNTED) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
|
||||
!(state !== UNMOUNTED) ? invariant_1(false, 'Unable to find node on an unmounted component.') : void 0;
|
||||
if (state === MOUNTING) {
|
||||
return null;
|
||||
}
|
||||
@ -265,7 +313,7 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
||||
}
|
||||
// We should never have an alternate for any mounting node. So the only
|
||||
// way this could possibly happen is if this was unmounted, if at all.
|
||||
invariant(false, 'Unable to find node on an unmounted component.');
|
||||
invariant_1(false, 'Unable to find node on an unmounted component.');
|
||||
}
|
||||
|
||||
if (a.return !== b.return) {
|
||||
@ -316,15 +364,15 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
||||
}
|
||||
_child = _child.sibling;
|
||||
}
|
||||
!didFindChild ? invariant(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0;
|
||||
!didFindChild ? invariant_1(false, 'Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.') : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
!(a.alternate === b) ? invariant(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
||||
!(a.alternate === b) ? invariant_1(false, 'Return fibers should always be each others\' alternates. This error is likely caused by a bug in React. Please file an issue.') : void 0;
|
||||
}
|
||||
// If the root is not a host container, we're in a disconnected tree. I.e.
|
||||
// unmounted.
|
||||
!(a.tag === HostRoot) ? invariant(false, 'Unable to find node on an unmounted component.') : void 0;
|
||||
!(a.tag === HostRoot) ? invariant_1(false, 'Unable to find node on an unmounted component.') : void 0;
|
||||
if (a.stateNode.current === a) {
|
||||
// We've determined that A is the current branch.
|
||||
return fiber;
|
||||
@ -335,8 +383,11 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
||||
|
||||
/* eslint valid-typeof: 0 */
|
||||
|
||||
var didWarnForAddedNewProperty = false;
|
||||
var EVENT_POOL_SIZE = 10;
|
||||
|
||||
var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
|
||||
|
||||
/**
|
||||
* @interface Event
|
||||
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
||||
@ -345,9 +396,7 @@ var EventInterface = {
|
||||
type: null,
|
||||
target: null,
|
||||
// currentTarget is set when dispatching; no use in copying it here
|
||||
currentTarget: function () {
|
||||
return null;
|
||||
},
|
||||
currentTarget: emptyFunction_1.thatReturnsNull,
|
||||
eventPhase: null,
|
||||
bubbles: null,
|
||||
cancelable: null,
|
||||
@ -358,14 +407,6 @@ var EventInterface = {
|
||||
isTrusted: null
|
||||
};
|
||||
|
||||
function functionThatReturnsTrue() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function functionThatReturnsFalse() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synthetic events are dispatched by event plugins, typically in response to a
|
||||
* top-level event delegation handler.
|
||||
@ -390,8 +431,6 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg
|
||||
delete this.nativeEvent;
|
||||
delete this.preventDefault;
|
||||
delete this.stopPropagation;
|
||||
delete this.isDefaultPrevented;
|
||||
delete this.isPropagationStopped;
|
||||
}
|
||||
|
||||
this.dispatchConfig = dispatchConfig;
|
||||
@ -420,11 +459,11 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg
|
||||
|
||||
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
||||
if (defaultPrevented) {
|
||||
this.isDefaultPrevented = functionThatReturnsTrue;
|
||||
this.isDefaultPrevented = emptyFunction_1.thatReturnsTrue;
|
||||
} else {
|
||||
this.isDefaultPrevented = functionThatReturnsFalse;
|
||||
this.isDefaultPrevented = emptyFunction_1.thatReturnsFalse;
|
||||
}
|
||||
this.isPropagationStopped = functionThatReturnsFalse;
|
||||
this.isPropagationStopped = emptyFunction_1.thatReturnsFalse;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -441,7 +480,7 @@ _assign(SyntheticEvent.prototype, {
|
||||
} else if (typeof event.returnValue !== 'unknown') {
|
||||
event.returnValue = false;
|
||||
}
|
||||
this.isDefaultPrevented = functionThatReturnsTrue;
|
||||
this.isDefaultPrevented = emptyFunction_1.thatReturnsTrue;
|
||||
},
|
||||
|
||||
stopPropagation: function () {
|
||||
@ -461,7 +500,7 @@ _assign(SyntheticEvent.prototype, {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
|
||||
this.isPropagationStopped = functionThatReturnsTrue;
|
||||
this.isPropagationStopped = emptyFunction_1.thatReturnsTrue;
|
||||
},
|
||||
|
||||
/**
|
||||
@ -470,7 +509,7 @@ _assign(SyntheticEvent.prototype, {
|
||||
* won't be added back into the pool.
|
||||
*/
|
||||
persist: function () {
|
||||
this.isPersistent = functionThatReturnsTrue;
|
||||
this.isPersistent = emptyFunction_1.thatReturnsTrue;
|
||||
},
|
||||
|
||||
/**
|
||||
@ -478,7 +517,7 @@ _assign(SyntheticEvent.prototype, {
|
||||
*
|
||||
* @return {boolean} True if this should not be released, false otherwise.
|
||||
*/
|
||||
isPersistent: functionThatReturnsFalse,
|
||||
isPersistent: emptyFunction_1.thatReturnsFalse,
|
||||
|
||||
/**
|
||||
* `PooledClass` looks for `destructor` on each instance it releases.
|
||||
@ -490,19 +529,13 @@ _assign(SyntheticEvent.prototype, {
|
||||
Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));
|
||||
}
|
||||
}
|
||||
this.dispatchConfig = null;
|
||||
this._targetInst = null;
|
||||
this.nativeEvent = null;
|
||||
this.isDefaultPrevented = functionThatReturnsFalse;
|
||||
this.isPropagationStopped = functionThatReturnsFalse;
|
||||
this._dispatchListeners = null;
|
||||
this._dispatchInstances = null;
|
||||
for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
|
||||
this[shouldBeReleasedProperties[i]] = null;
|
||||
}
|
||||
{
|
||||
Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));
|
||||
Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));
|
||||
Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));
|
||||
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));
|
||||
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));
|
||||
Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', emptyFunction_1));
|
||||
Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', emptyFunction_1));
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -533,6 +566,38 @@ SyntheticEvent.extend = function (Interface) {
|
||||
return Class;
|
||||
};
|
||||
|
||||
/** Proxying after everything set on SyntheticEvent
|
||||
* to resolve Proxy issue on some WebKit browsers
|
||||
* in which some Event properties are set to undefined (GH#10010)
|
||||
*/
|
||||
{
|
||||
var isProxySupported = typeof Proxy === 'function' &&
|
||||
// https://github.com/facebook/react/issues/12011
|
||||
!Object.isSealed(new Proxy({}, {}));
|
||||
|
||||
if (isProxySupported) {
|
||||
/*eslint-disable no-func-assign */
|
||||
SyntheticEvent = new Proxy(SyntheticEvent, {
|
||||
construct: function (target, args) {
|
||||
return this.apply(target, Object.create(target.prototype), args);
|
||||
},
|
||||
apply: function (constructor, that, args) {
|
||||
return new Proxy(constructor.apply(that, args), {
|
||||
set: function (target, prop, value) {
|
||||
if (prop !== 'isPersistent' && !target.constructor.Interface.hasOwnProperty(prop) && shouldBeReleasedProperties.indexOf(prop) === -1) {
|
||||
!(didWarnForAddedNewProperty || target.isPersistent()) ? warning_1(false, "This synthetic event is reused for performance reasons. If you're " + "seeing this, you're adding a new property in the synthetic event object. " + 'The property is never released. See ' + 'https://fb.me/react-event-pooling for more information.') : void 0;
|
||||
didWarnForAddedNewProperty = true;
|
||||
}
|
||||
target[prop] = value;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
/*eslint-enable no-func-assign */
|
||||
}
|
||||
}
|
||||
|
||||
addEventPoolingTo(SyntheticEvent);
|
||||
|
||||
/**
|
||||
@ -565,7 +630,7 @@ function getPooledWarningPropertyDefinition(propName, getVal) {
|
||||
|
||||
function warn(action, result) {
|
||||
var warningCondition = false;
|
||||
!warningCondition ? warningWithoutStack$1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
|
||||
!warningCondition ? warning_1(false, "This synthetic event is reused for performance reasons. If you're seeing this, " + "you're %s `%s` on a released/nullified synthetic event. %s. " + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -581,7 +646,7 @@ function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
|
||||
|
||||
function releasePooledEvent(event) {
|
||||
var EventConstructor = this;
|
||||
!(event instanceof EventConstructor) ? invariant(false, 'Trying to release an event instance into a pool of a different type.') : void 0;
|
||||
!(event instanceof EventConstructor) ? invariant_1(false, 'Trying to release an event instance into a pool of a different type.') : void 0;
|
||||
event.destructor();
|
||||
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
|
||||
EventConstructor.eventPool.push(event);
|
||||
@ -594,64 +659,7 @@ function addEventPoolingTo(EventConstructor) {
|
||||
EventConstructor.release = releasePooledEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Forked from fbjs/warning:
|
||||
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
||||
*
|
||||
* Only change is we use console.warn instead of console.error,
|
||||
* and do nothing when 'console' is not supported.
|
||||
* This really simplifies the code.
|
||||
* ---
|
||||
* Similar to invariant but only logs a warning if the condition is not met.
|
||||
* This can be used to log issues in development environments in critical
|
||||
* paths. Removing the logging code for production environments will keep the
|
||||
* same logic and follow the same code paths.
|
||||
*/
|
||||
|
||||
var lowPriorityWarning = function () {};
|
||||
|
||||
{
|
||||
var printWarning = function (format) {
|
||||
for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
||||
args[_key - 1] = arguments[_key];
|
||||
}
|
||||
|
||||
var argIndex = 0;
|
||||
var message = 'Warning: ' + format.replace(/%s/g, function () {
|
||||
return args[argIndex++];
|
||||
});
|
||||
if (typeof console !== 'undefined') {
|
||||
console.warn(message);
|
||||
}
|
||||
try {
|
||||
// --- Welcome to debugging React ---
|
||||
// This error was thrown as a convenience so that you can use this stack
|
||||
// to find the callsite that caused this warning to fire.
|
||||
throw new Error(message);
|
||||
} catch (x) {}
|
||||
};
|
||||
|
||||
lowPriorityWarning = function (condition, format) {
|
||||
if (format === undefined) {
|
||||
throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
||||
}
|
||||
if (!condition) {
|
||||
for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
||||
args[_key2 - 2] = arguments[_key2];
|
||||
}
|
||||
|
||||
printWarning.apply(undefined, [format].concat(args));
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
var lowPriorityWarning$1 = lowPriorityWarning;
|
||||
|
||||
/**
|
||||
* HTML nodeType values that represent the type of the node
|
||||
*/
|
||||
|
||||
var ELEMENT_NODE = 1;
|
||||
var SyntheticEvent$1 = SyntheticEvent;
|
||||
|
||||
// Do not uses the below two methods directly!
|
||||
// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
|
||||
@ -661,8 +669,40 @@ function unsafeCastStringToDOMTopLevelType(topLevelType) {
|
||||
return topLevelType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
||||
|
||||
/**
|
||||
* Simple, lightweight module assisting with the detection and context of
|
||||
* Worker. Helps avoid circular dependencies and allows code to reason about
|
||||
* whether or not they are in a Worker, even if they never include the main
|
||||
* `ReactWorker` dependency.
|
||||
*/
|
||||
var ExecutionEnvironment = {
|
||||
|
||||
canUseDOM: canUseDOM,
|
||||
|
||||
canUseWorkers: typeof Worker !== 'undefined',
|
||||
|
||||
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
|
||||
|
||||
canUseViewport: canUseDOM && !!window.screen,
|
||||
|
||||
isInWorker: !canUseDOM // For now, this is true - might change in the future.
|
||||
|
||||
};
|
||||
|
||||
var ExecutionEnvironment_1 = ExecutionEnvironment;
|
||||
|
||||
/**
|
||||
* Generate a mapping of standard vendor prefixes using the defined style property and event name.
|
||||
*
|
||||
@ -676,6 +716,8 @@ function makePrefixMap(styleProp, eventName) {
|
||||
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
||||
prefixes['Webkit' + styleProp] = 'webkit' + eventName;
|
||||
prefixes['Moz' + styleProp] = 'moz' + eventName;
|
||||
prefixes['ms' + styleProp] = 'MS' + eventName;
|
||||
prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
@ -703,7 +745,7 @@ var style = {};
|
||||
/**
|
||||
* Bootstrap if a DOM exists.
|
||||
*/
|
||||
if (canUseDOM) {
|
||||
if (ExecutionEnvironment_1.canUseDOM) {
|
||||
style = document.createElementNS('http://www.w3.org/1999/xhtml', 'div').style;
|
||||
|
||||
// On some platforms, in particular some releases of Android 4.x,
|
||||
@ -771,7 +813,6 @@ var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
|
||||
var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
|
||||
var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
|
||||
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
|
||||
|
||||
var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
|
||||
var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
|
||||
var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
|
||||
@ -840,29 +881,18 @@ var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');
|
||||
// Note that events in this list will *not* be listened to at the top level
|
||||
// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
|
||||
|
||||
// for .act's return value
|
||||
var findDOMNode = ReactDOM.findDOMNode;
|
||||
// Keep in sync with ReactDOMUnstableNativeDependencies.js
|
||||
// and ReactDOM.js:
|
||||
|
||||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;
|
||||
var getInstanceFromNode = _ReactDOM$__SECRET_IN[0];
|
||||
var getNodeFromInstance = _ReactDOM$__SECRET_IN[1];
|
||||
var getFiberCurrentPropsFromNode = _ReactDOM$__SECRET_IN[2];
|
||||
var injectEventPluginsByName = _ReactDOM$__SECRET_IN[3];
|
||||
var eventNameDispatchConfigs = _ReactDOM$__SECRET_IN[4];
|
||||
var accumulateTwoPhaseDispatches = _ReactDOM$__SECRET_IN[5];
|
||||
var accumulateDirectDispatches = _ReactDOM$__SECRET_IN[6];
|
||||
var enqueueStateRestore = _ReactDOM$__SECRET_IN[7];
|
||||
var restoreStateIfNeeded = _ReactDOM$__SECRET_IN[8];
|
||||
var dispatchEvent = _ReactDOM$__SECRET_IN[9];
|
||||
var runEventsInBatch = _ReactDOM$__SECRET_IN[10];
|
||||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
var EventPluginHub = _ReactDOM$__SECRET_IN.EventPluginHub;
|
||||
var EventPluginRegistry = _ReactDOM$__SECRET_IN.EventPluginRegistry;
|
||||
var EventPropagators = _ReactDOM$__SECRET_IN.EventPropagators;
|
||||
var ReactControlledComponent = _ReactDOM$__SECRET_IN.ReactControlledComponent;
|
||||
var ReactDOMComponentTree = _ReactDOM$__SECRET_IN.ReactDOMComponentTree;
|
||||
var ReactDOMEventListener = _ReactDOM$__SECRET_IN.ReactDOMEventListener;
|
||||
|
||||
|
||||
function Event(suffix) {}
|
||||
|
||||
var hasWarnedAboutDeprecatedMockComponent = false;
|
||||
|
||||
/**
|
||||
* @class ReactTestUtils
|
||||
*/
|
||||
@ -876,7 +906,7 @@ var hasWarnedAboutDeprecatedMockComponent = false;
|
||||
*/
|
||||
function simulateNativeEventOnNode(topLevelType, node, fakeNativeEvent) {
|
||||
fakeNativeEvent.target = node;
|
||||
dispatchEvent(topLevelType, fakeNativeEvent);
|
||||
ReactDOMEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -901,7 +931,7 @@ function findAllInRenderedFiberTreeInternal(fiber, test) {
|
||||
var node = currentParent;
|
||||
var ret = [];
|
||||
while (true) {
|
||||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionComponent) {
|
||||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionalComponent) {
|
||||
var publicInst = node.stateNode;
|
||||
if (test(publicInst)) {
|
||||
ret.push(publicInst);
|
||||
@ -926,32 +956,6 @@ function findAllInRenderedFiberTreeInternal(fiber, test) {
|
||||
}
|
||||
}
|
||||
|
||||
function validateClassInstance(inst, methodName) {
|
||||
if (!inst) {
|
||||
// This is probably too relaxed but it's existing behavior.
|
||||
return;
|
||||
}
|
||||
if (get(inst)) {
|
||||
// This is a public instance indeed.
|
||||
return;
|
||||
}
|
||||
var received = void 0;
|
||||
var stringified = '' + inst;
|
||||
if (Array.isArray(inst)) {
|
||||
received = 'an array';
|
||||
} else if (inst && inst.nodeType === ELEMENT_NODE && inst.tagName) {
|
||||
received = 'a DOM node';
|
||||
} else if (stringified === '[object Object]') {
|
||||
received = 'object with keys {' + Object.keys(inst).join(', ') + '}';
|
||||
} else {
|
||||
received = stringified;
|
||||
}
|
||||
invariant(false, '%s(...): the first argument must be a React class instance. Instead received: %s.', methodName, received);
|
||||
}
|
||||
|
||||
// a stub element, lazily initialized, used by act() when flushing effects
|
||||
var actContainerElement = null;
|
||||
|
||||
/**
|
||||
* Utilities for making it easy to test React components.
|
||||
*
|
||||
@ -981,7 +985,7 @@ var ReactTestUtils = {
|
||||
},
|
||||
|
||||
isDOMComponent: function (inst) {
|
||||
return !!(inst && inst.nodeType === ELEMENT_NODE && inst.tagName);
|
||||
return !!(inst && inst.nodeType === 1 && inst.tagName);
|
||||
},
|
||||
|
||||
isDOMComponentElement: function (inst) {
|
||||
@ -1007,10 +1011,10 @@ var ReactTestUtils = {
|
||||
},
|
||||
|
||||
findAllInRenderedTree: function (inst, test) {
|
||||
validateClassInstance(inst, 'findAllInRenderedTree');
|
||||
if (!inst) {
|
||||
return [];
|
||||
}
|
||||
!ReactTestUtils.isCompositeComponent(inst) ? invariant_1(false, 'findAllInRenderedTree(...): instance must be a composite component') : void 0;
|
||||
var internalInstance = get(inst);
|
||||
return findAllInRenderedFiberTreeInternal(internalInstance, test);
|
||||
},
|
||||
@ -1021,7 +1025,6 @@ var ReactTestUtils = {
|
||||
* @return {array} an array of all the matches.
|
||||
*/
|
||||
scryRenderedDOMComponentsWithClass: function (root, classNames) {
|
||||
validateClassInstance(root, 'scryRenderedDOMComponentsWithClass');
|
||||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
||||
if (ReactTestUtils.isDOMComponent(inst)) {
|
||||
var className = inst.className;
|
||||
@ -1032,7 +1035,7 @@ var ReactTestUtils = {
|
||||
var classList = className.split(/\s+/);
|
||||
|
||||
if (!Array.isArray(classNames)) {
|
||||
!(classNames !== undefined) ? invariant(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.') : void 0;
|
||||
!(classNames !== undefined) ? invariant_1(false, 'TestUtils.scryRenderedDOMComponentsWithClass expects a className as a second argument.') : void 0;
|
||||
classNames = classNames.split(/\s+/);
|
||||
}
|
||||
return classNames.every(function (name) {
|
||||
@ -1050,7 +1053,6 @@ var ReactTestUtils = {
|
||||
* @return {!ReactDOMComponent} The one match.
|
||||
*/
|
||||
findRenderedDOMComponentWithClass: function (root, className) {
|
||||
validateClassInstance(root, 'findRenderedDOMComponentWithClass');
|
||||
var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
|
||||
if (all.length !== 1) {
|
||||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
|
||||
@ -1064,7 +1066,6 @@ var ReactTestUtils = {
|
||||
* @return {array} an array of all the matches.
|
||||
*/
|
||||
scryRenderedDOMComponentsWithTag: function (root, tagName) {
|
||||
validateClassInstance(root, 'scryRenderedDOMComponentsWithTag');
|
||||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
||||
return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
|
||||
});
|
||||
@ -1077,7 +1078,6 @@ var ReactTestUtils = {
|
||||
* @return {!ReactDOMComponent} The one match.
|
||||
*/
|
||||
findRenderedDOMComponentWithTag: function (root, tagName) {
|
||||
validateClassInstance(root, 'findRenderedDOMComponentWithTag');
|
||||
var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
|
||||
if (all.length !== 1) {
|
||||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
|
||||
@ -1090,7 +1090,6 @@ var ReactTestUtils = {
|
||||
* @return {array} an array of all the matches.
|
||||
*/
|
||||
scryRenderedComponentsWithType: function (root, componentType) {
|
||||
validateClassInstance(root, 'scryRenderedComponentsWithType');
|
||||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
||||
return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
|
||||
});
|
||||
@ -1103,7 +1102,6 @@ var ReactTestUtils = {
|
||||
* @return {!ReactComponent} The one match.
|
||||
*/
|
||||
findRenderedComponentWithType: function (root, componentType) {
|
||||
validateClassInstance(root, 'findRenderedComponentWithType');
|
||||
var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
|
||||
if (all.length !== 1) {
|
||||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
|
||||
@ -1125,11 +1123,6 @@ var ReactTestUtils = {
|
||||
* @return {object} the ReactTestUtils object (for chaining)
|
||||
*/
|
||||
mockComponent: function (module, mockTagName) {
|
||||
if (!hasWarnedAboutDeprecatedMockComponent) {
|
||||
hasWarnedAboutDeprecatedMockComponent = true;
|
||||
lowPriorityWarning$1(false, 'ReactTestUtils.mockComponent() is deprecated. ' + 'Use shallow rendering or jest.mock() instead.\n\n' + 'See https://fb.me/test-utils-mock-component for more information.');
|
||||
}
|
||||
|
||||
mockTagName = mockTagName || module.mockTagName || 'div';
|
||||
|
||||
module.prototype.render.mockImplementation(function () {
|
||||
@ -1146,43 +1139,7 @@ var ReactTestUtils = {
|
||||
},
|
||||
|
||||
Simulate: null,
|
||||
SimulateNative: {},
|
||||
|
||||
act: function (callback) {
|
||||
if (actContainerElement === null) {
|
||||
// warn if we can't actually create the stub element
|
||||
{
|
||||
!(typeof document !== 'undefined' && document !== null && typeof document.createElement === 'function') ? warningWithoutStack$1(false, 'It looks like you called TestUtils.act(...) in a non-browser environment. ' + "If you're using TestRenderer for your tests, you should call " + 'TestRenderer.act(...) instead of TestUtils.act(...).') : void 0;
|
||||
}
|
||||
// then make it
|
||||
actContainerElement = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
|
||||
}
|
||||
|
||||
var result = ReactDOM.unstable_batchedUpdates(callback);
|
||||
// note: keep these warning messages in sync with
|
||||
// createReactNoop.js and ReactTestRenderer.js
|
||||
{
|
||||
if (result !== undefined) {
|
||||
var addendum = void 0;
|
||||
if (result !== null && typeof result.then === 'function') {
|
||||
addendum = '\n\nIt looks like you wrote ReactTestUtils.act(async () => ...), ' + 'or returned a Promise from the callback passed to it. ' + 'Putting asynchronous logic inside ReactTestUtils.act(...) is not supported.\n';
|
||||
} else {
|
||||
addendum = ' You returned: ' + result;
|
||||
}
|
||||
warningWithoutStack$1(false, 'The callback passed to ReactTestUtils.act(...) function must not return anything.%s', addendum);
|
||||
}
|
||||
}
|
||||
ReactDOM.render(React.createElement('div', null), actContainerElement);
|
||||
// we want the user to not expect a return,
|
||||
// but we want to warn if they use it like they can await on it.
|
||||
return {
|
||||
then: function () {
|
||||
{
|
||||
warningWithoutStack$1(false, 'Do not await the result of calling ReactTestUtils.act(...), it is not a Promise.');
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
SimulateNative: {}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1195,10 +1152,10 @@ var ReactTestUtils = {
|
||||
*/
|
||||
function makeSimulator(eventType) {
|
||||
return function (domNode, eventData) {
|
||||
!!React.isValidElement(domNode) ? invariant(false, 'TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering.') : void 0;
|
||||
!!ReactTestUtils.isCompositeComponent(domNode) ? invariant(false, 'TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.') : void 0;
|
||||
!!React.isValidElement(domNode) ? invariant_1(false, 'TestUtils.Simulate expected a DOM node as the first argument but received a React element. Pass the DOM node you wish to simulate the event on instead. Note that TestUtils.Simulate will not work if you are using shallow rendering.') : void 0;
|
||||
!!ReactTestUtils.isCompositeComponent(domNode) ? invariant_1(false, 'TestUtils.Simulate expected a DOM node as the first argument but received a component instance. Pass the DOM node you wish to simulate the event on instead.') : void 0;
|
||||
|
||||
var dispatchConfig = eventNameDispatchConfigs[eventType];
|
||||
var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
|
||||
|
||||
var fakeNativeEvent = new Event();
|
||||
fakeNativeEvent.target = domNode;
|
||||
@ -1206,8 +1163,8 @@ function makeSimulator(eventType) {
|
||||
|
||||
// We don't use SyntheticEvent.getPooled in order to not have to worry about
|
||||
// properly destroying any properties assigned from `eventData` upon release
|
||||
var targetInst = getInstanceFromNode(domNode);
|
||||
var event = new SyntheticEvent(dispatchConfig, targetInst, fakeNativeEvent, domNode);
|
||||
var targetInst = ReactDOMComponentTree.getInstanceFromNode(domNode);
|
||||
var event = new SyntheticEvent$1(dispatchConfig, targetInst, fakeNativeEvent, domNode);
|
||||
|
||||
// Since we aren't using pooling, always persist the event. This will make
|
||||
// sure it's marked and won't warn when setting additional properties.
|
||||
@ -1215,18 +1172,18 @@ function makeSimulator(eventType) {
|
||||
_assign(event, eventData);
|
||||
|
||||
if (dispatchConfig.phasedRegistrationNames) {
|
||||
accumulateTwoPhaseDispatches(event);
|
||||
EventPropagators.accumulateTwoPhaseDispatches(event);
|
||||
} else {
|
||||
accumulateDirectDispatches(event);
|
||||
EventPropagators.accumulateDirectDispatches(event);
|
||||
}
|
||||
|
||||
ReactDOM.unstable_batchedUpdates(function () {
|
||||
// Normally extractEvent enqueues a state restore, but we'll just always
|
||||
// do that since we're by-passing it here.
|
||||
enqueueStateRestore(domNode);
|
||||
runEventsInBatch(event);
|
||||
// do that since we we're by-passing it here.
|
||||
ReactControlledComponent.enqueueStateRestore(domNode);
|
||||
EventPluginHub.runEventsInBatch(event, true);
|
||||
});
|
||||
restoreStateIfNeeded();
|
||||
ReactControlledComponent.restoreStateIfNeeded();
|
||||
};
|
||||
}
|
||||
|
||||
@ -1234,7 +1191,7 @@ function buildSimulators() {
|
||||
ReactTestUtils.Simulate = {};
|
||||
|
||||
var eventType = void 0;
|
||||
for (eventType in eventNameDispatchConfigs) {
|
||||
for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
|
||||
/**
|
||||
* @param {!Element|ReactDOMComponent} domComponentOrNode
|
||||
* @param {?object} eventData Fake event data to use in SyntheticEvent.
|
||||
@ -1243,6 +1200,18 @@ function buildSimulators() {
|
||||
}
|
||||
}
|
||||
|
||||
// Rebuild ReactTestUtils.Simulate whenever event plugins are injected
|
||||
var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
|
||||
EventPluginHub.injection.injectEventPluginOrder = function () {
|
||||
oldInjectEventPluginOrder.apply(this, arguments);
|
||||
buildSimulators();
|
||||
};
|
||||
var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
|
||||
EventPluginHub.injection.injectEventPluginsByName = function () {
|
||||
oldInjectEventPlugins.apply(this, arguments);
|
||||
buildSimulators();
|
||||
};
|
||||
|
||||
buildSimulators();
|
||||
|
||||
/**
|
||||
@ -1295,7 +1264,7 @@ var ReactTestUtils$3 = ( ReactTestUtils$2 && ReactTestUtils ) || ReactTestUtils$
|
||||
|
||||
// TODO: decide on the top-level export form.
|
||||
// This is hacky but makes it work with both Rollup and Jest.
|
||||
var testUtils = ReactTestUtils$3.default || ReactTestUtils$3;
|
||||
var testUtils = ReactTestUtils$3.default ? ReactTestUtils$3.default : ReactTestUtils$3;
|
||||
|
||||
return testUtils;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/** @license React v16.8.6
|
||||
/** @license React v16.4.1
|
||||
* react-dom-test-utils.production.min.js
|
||||
*
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
@ -17,19 +17,18 @@ var ReactInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
var _assign = ReactInternals.assign;
|
||||
|
||||
/**
|
||||
* Use invariant() to assert state which your program assumes to be true.
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* Provide sprintf-style format (only %s is supported) and arguments
|
||||
* to provide information about what broke and what you were
|
||||
* expecting.
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* The invariant message will be stripped in production, but the invariant
|
||||
* will remain to ensure logic does not differ in production.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
function invariant(condition, format, a, b, c, d, e, f) {
|
||||
if (!condition) {
|
||||
var error = void 0;
|
||||
var error;
|
||||
if (format === undefined) {
|
||||
error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');
|
||||
} else {
|
||||
@ -46,8 +45,10 @@ function invariant(condition, format, a, b, c, d, e, f) {
|
||||
}
|
||||
}
|
||||
|
||||
var invariant_1 = invariant;
|
||||
|
||||
// Relying on the `invariant()` implementation lets us
|
||||
// preserve the format and params in the www builds.
|
||||
// have preserve the format and params in the www builds.
|
||||
/**
|
||||
* WARNING: DO NOT manually require this module.
|
||||
* This is a replacement for `invariant(...)` used by the error code system
|
||||
@ -60,9 +61,9 @@ function reactProdInvariant(code) {
|
||||
for (var argIdx = 0; argIdx < argCount; argIdx++) {
|
||||
url += '&args[]=' + encodeURIComponent(arguments[argIdx + 1]);
|
||||
}
|
||||
// Rename it so that our build transform doesn't attempt
|
||||
// Rename it so that our build transform doesn't atttempt
|
||||
// to replace this invariant() call with reactProdInvariant().
|
||||
var i = invariant;
|
||||
var i = invariant_1;
|
||||
i(false,
|
||||
// The error code is intentionally part of the message (and
|
||||
// not the format argument) so that we could deduplicate
|
||||
@ -71,10 +72,46 @@ function reactProdInvariant(code) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to invariant but only logs a warning if the condition is not met.
|
||||
* This can be used to log issues in development environments in critical
|
||||
* paths. Removing the logging code for production environments will keep the
|
||||
* same logic and follow the same code paths.
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
function makeEmptyFunction(arg) {
|
||||
return function () {
|
||||
return arg;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* This function accepts and discards inputs; it has no side effects. This is
|
||||
* primarily useful idiomatically for overridable function endpoints which
|
||||
* always need to be callable, since JS lacks a null-call idiom ala Cocoa.
|
||||
*/
|
||||
var emptyFunction = function emptyFunction() {};
|
||||
|
||||
emptyFunction.thatReturns = makeEmptyFunction;
|
||||
emptyFunction.thatReturnsFalse = makeEmptyFunction(false);
|
||||
emptyFunction.thatReturnsTrue = makeEmptyFunction(true);
|
||||
emptyFunction.thatReturnsNull = makeEmptyFunction(null);
|
||||
emptyFunction.thatReturnsThis = function () {
|
||||
return this;
|
||||
};
|
||||
emptyFunction.thatReturnsArgument = function (arg) {
|
||||
return arg;
|
||||
};
|
||||
|
||||
var emptyFunction_1 = emptyFunction;
|
||||
|
||||
/**
|
||||
* Copyright (c) 2014-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -98,23 +135,16 @@ function get(key) {
|
||||
return key._reactInternalFiber;
|
||||
}
|
||||
|
||||
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
var ReactInternals$1 = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
|
||||
// Prevent newer renderers from RTE when used with older react package versions.
|
||||
// Current owner and dispatcher used to share the same ref,
|
||||
// but PR #14548 split them out to better support the react-debug-tools package.
|
||||
if (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {
|
||||
ReactSharedInternals.ReactCurrentDispatcher = {
|
||||
current: null
|
||||
};
|
||||
}
|
||||
var ReactCurrentOwner = ReactInternals$1.ReactCurrentOwner;
|
||||
|
||||
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
||||
// nor polyfill, then a plain number is used for performance.
|
||||
|
||||
var FunctionComponent = 0;
|
||||
var ClassComponent = 1;
|
||||
// Before we know whether it is function or class
|
||||
// Before we know whether it is functional or class
|
||||
var FunctionalComponent = 1;
|
||||
var ClassComponent = 2;
|
||||
var HostRoot = 3; // Root of a host tree. Could be nested inside another node.
|
||||
// A subtree. Could be an entry point to a different renderer.
|
||||
var HostComponent = 5;
|
||||
@ -135,14 +165,8 @@ var Placement = /* */2;
|
||||
|
||||
|
||||
|
||||
|
||||
// Passive & Update & Callback & Ref & Snapshot
|
||||
|
||||
|
||||
// Union of all host effects
|
||||
|
||||
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
||||
|
||||
var MOUNTING = 1;
|
||||
var MOUNTED = 2;
|
||||
var UNMOUNTED = 3;
|
||||
@ -300,6 +324,8 @@ function findCurrentFiberUsingSlowPath(fiber) {
|
||||
|
||||
var EVENT_POOL_SIZE = 10;
|
||||
|
||||
var shouldBeReleasedProperties = ['dispatchConfig', '_targetInst', 'nativeEvent', 'isDefaultPrevented', 'isPropagationStopped', '_dispatchListeners', '_dispatchInstances'];
|
||||
|
||||
/**
|
||||
* @interface Event
|
||||
* @see http://www.w3.org/TR/DOM-Level-3-Events/
|
||||
@ -308,9 +334,7 @@ var EventInterface = {
|
||||
type: null,
|
||||
target: null,
|
||||
// currentTarget is set when dispatching; no use in copying it here
|
||||
currentTarget: function () {
|
||||
return null;
|
||||
},
|
||||
currentTarget: emptyFunction_1.thatReturnsNull,
|
||||
eventPhase: null,
|
||||
bubbles: null,
|
||||
cancelable: null,
|
||||
@ -321,14 +345,6 @@ var EventInterface = {
|
||||
isTrusted: null
|
||||
};
|
||||
|
||||
function functionThatReturnsTrue() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function functionThatReturnsFalse() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synthetic events are dispatched by event plugins, typically in response to a
|
||||
* top-level event delegation handler.
|
||||
@ -371,11 +387,11 @@ function SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarg
|
||||
|
||||
var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;
|
||||
if (defaultPrevented) {
|
||||
this.isDefaultPrevented = functionThatReturnsTrue;
|
||||
this.isDefaultPrevented = emptyFunction_1.thatReturnsTrue;
|
||||
} else {
|
||||
this.isDefaultPrevented = functionThatReturnsFalse;
|
||||
this.isDefaultPrevented = emptyFunction_1.thatReturnsFalse;
|
||||
}
|
||||
this.isPropagationStopped = functionThatReturnsFalse;
|
||||
this.isPropagationStopped = emptyFunction_1.thatReturnsFalse;
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -392,7 +408,7 @@ _assign(SyntheticEvent.prototype, {
|
||||
} else if (typeof event.returnValue !== 'unknown') {
|
||||
event.returnValue = false;
|
||||
}
|
||||
this.isDefaultPrevented = functionThatReturnsTrue;
|
||||
this.isDefaultPrevented = emptyFunction_1.thatReturnsTrue;
|
||||
},
|
||||
|
||||
stopPropagation: function () {
|
||||
@ -412,7 +428,7 @@ _assign(SyntheticEvent.prototype, {
|
||||
event.cancelBubble = true;
|
||||
}
|
||||
|
||||
this.isPropagationStopped = functionThatReturnsTrue;
|
||||
this.isPropagationStopped = emptyFunction_1.thatReturnsTrue;
|
||||
},
|
||||
|
||||
/**
|
||||
@ -421,7 +437,7 @@ _assign(SyntheticEvent.prototype, {
|
||||
* won't be added back into the pool.
|
||||
*/
|
||||
persist: function () {
|
||||
this.isPersistent = functionThatReturnsTrue;
|
||||
this.isPersistent = emptyFunction_1.thatReturnsTrue;
|
||||
},
|
||||
|
||||
/**
|
||||
@ -429,7 +445,7 @@ _assign(SyntheticEvent.prototype, {
|
||||
*
|
||||
* @return {boolean} True if this should not be released, false otherwise.
|
||||
*/
|
||||
isPersistent: functionThatReturnsFalse,
|
||||
isPersistent: emptyFunction_1.thatReturnsFalse,
|
||||
|
||||
/**
|
||||
* `PooledClass` looks for `destructor` on each instance it releases.
|
||||
@ -441,13 +457,9 @@ _assign(SyntheticEvent.prototype, {
|
||||
this[propName] = null;
|
||||
}
|
||||
}
|
||||
this.dispatchConfig = null;
|
||||
this._targetInst = null;
|
||||
this.nativeEvent = null;
|
||||
this.isDefaultPrevented = functionThatReturnsFalse;
|
||||
this.isPropagationStopped = functionThatReturnsFalse;
|
||||
this._dispatchListeners = null;
|
||||
this._dispatchInstances = null;
|
||||
for (var i = 0; i < shouldBeReleasedProperties.length; i++) {
|
||||
this[shouldBeReleasedProperties[i]] = null;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@ -478,6 +490,10 @@ SyntheticEvent.extend = function (Interface) {
|
||||
return Class;
|
||||
};
|
||||
|
||||
/** Proxying after everything set on SyntheticEvent
|
||||
* to resolve Proxy issue on some WebKit browsers
|
||||
* in which some Event properties are set to undefined (GH#10010)
|
||||
*/
|
||||
addEventPoolingTo(SyntheticEvent);
|
||||
|
||||
function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
|
||||
@ -492,7 +508,7 @@ function getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {
|
||||
|
||||
function releasePooledEvent(event) {
|
||||
var EventConstructor = this;
|
||||
!(event instanceof EventConstructor) ? reactProdInvariant('279') : void 0;
|
||||
!(event instanceof EventConstructor) ? reactProdInvariant('223') : void 0;
|
||||
event.destructor();
|
||||
if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {
|
||||
EventConstructor.eventPool.push(event);
|
||||
@ -505,26 +521,6 @@ function addEventPoolingTo(EventConstructor) {
|
||||
EventConstructor.release = releasePooledEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Forked from fbjs/warning:
|
||||
* https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
|
||||
*
|
||||
* Only change is we use console.warn instead of console.error,
|
||||
* and do nothing when 'console' is not supported.
|
||||
* This really simplifies the code.
|
||||
* ---
|
||||
* Similar to invariant but only logs a warning if the condition is not met.
|
||||
* This can be used to log issues in development environments in critical
|
||||
* paths. Removing the logging code for production environments will keep the
|
||||
* same logic and follow the same code paths.
|
||||
*/
|
||||
|
||||
/**
|
||||
* HTML nodeType values that represent the type of the node
|
||||
*/
|
||||
|
||||
var ELEMENT_NODE = 1;
|
||||
|
||||
// Do not uses the below two methods directly!
|
||||
// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.
|
||||
// (It is the only module that is allowed to access these methods.)
|
||||
@ -533,8 +529,40 @@ function unsafeCastStringToDOMTopLevelType(topLevelType) {
|
||||
return topLevelType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) 2013-present, Facebook, Inc.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
||||
|
||||
/**
|
||||
* Simple, lightweight module assisting with the detection and context of
|
||||
* Worker. Helps avoid circular dependencies and allows code to reason about
|
||||
* whether or not they are in a Worker, even if they never include the main
|
||||
* `ReactWorker` dependency.
|
||||
*/
|
||||
var ExecutionEnvironment = {
|
||||
|
||||
canUseDOM: canUseDOM,
|
||||
|
||||
canUseWorkers: typeof Worker !== 'undefined',
|
||||
|
||||
canUseEventListeners: canUseDOM && !!(window.addEventListener || window.attachEvent),
|
||||
|
||||
canUseViewport: canUseDOM && !!window.screen,
|
||||
|
||||
isInWorker: !canUseDOM // For now, this is true - might change in the future.
|
||||
|
||||
};
|
||||
|
||||
var ExecutionEnvironment_1 = ExecutionEnvironment;
|
||||
|
||||
/**
|
||||
* Generate a mapping of standard vendor prefixes using the defined style property and event name.
|
||||
*
|
||||
@ -548,6 +576,8 @@ function makePrefixMap(styleProp, eventName) {
|
||||
prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();
|
||||
prefixes['Webkit' + styleProp] = 'webkit' + eventName;
|
||||
prefixes['Moz' + styleProp] = 'moz' + eventName;
|
||||
prefixes['ms' + styleProp] = 'MS' + eventName;
|
||||
prefixes['O' + styleProp] = 'o' + eventName.toLowerCase();
|
||||
|
||||
return prefixes;
|
||||
}
|
||||
@ -575,7 +605,7 @@ var style = {};
|
||||
/**
|
||||
* Bootstrap if a DOM exists.
|
||||
*/
|
||||
if (canUseDOM) {
|
||||
if (ExecutionEnvironment_1.canUseDOM) {
|
||||
style = document.createElementNS('http://www.w3.org/1999/xhtml', 'div').style;
|
||||
|
||||
// On some platforms, in particular some releases of Android 4.x,
|
||||
@ -643,7 +673,6 @@ var TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');
|
||||
var TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');
|
||||
var TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');
|
||||
var TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');
|
||||
|
||||
var TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');
|
||||
var TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');
|
||||
var TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');
|
||||
@ -712,23 +741,14 @@ var TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel');
|
||||
// Note that events in this list will *not* be listened to at the top level
|
||||
// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.
|
||||
|
||||
// for .act's return value
|
||||
var findDOMNode = ReactDOM.findDOMNode;
|
||||
// Keep in sync with ReactDOMUnstableNativeDependencies.js
|
||||
// and ReactDOM.js:
|
||||
|
||||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Events;
|
||||
var getInstanceFromNode = _ReactDOM$__SECRET_IN[0];
|
||||
var getNodeFromInstance = _ReactDOM$__SECRET_IN[1];
|
||||
var getFiberCurrentPropsFromNode = _ReactDOM$__SECRET_IN[2];
|
||||
var injectEventPluginsByName = _ReactDOM$__SECRET_IN[3];
|
||||
var eventNameDispatchConfigs = _ReactDOM$__SECRET_IN[4];
|
||||
var accumulateTwoPhaseDispatches = _ReactDOM$__SECRET_IN[5];
|
||||
var accumulateDirectDispatches = _ReactDOM$__SECRET_IN[6];
|
||||
var enqueueStateRestore = _ReactDOM$__SECRET_IN[7];
|
||||
var restoreStateIfNeeded = _ReactDOM$__SECRET_IN[8];
|
||||
var dispatchEvent = _ReactDOM$__SECRET_IN[9];
|
||||
var runEventsInBatch = _ReactDOM$__SECRET_IN[10];
|
||||
var _ReactDOM$__SECRET_IN = ReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
||||
var EventPluginHub = _ReactDOM$__SECRET_IN.EventPluginHub;
|
||||
var EventPluginRegistry = _ReactDOM$__SECRET_IN.EventPluginRegistry;
|
||||
var EventPropagators = _ReactDOM$__SECRET_IN.EventPropagators;
|
||||
var ReactControlledComponent = _ReactDOM$__SECRET_IN.ReactControlledComponent;
|
||||
var ReactDOMComponentTree = _ReactDOM$__SECRET_IN.ReactDOMComponentTree;
|
||||
var ReactDOMEventListener = _ReactDOM$__SECRET_IN.ReactDOMEventListener;
|
||||
|
||||
|
||||
function Event(suffix) {}
|
||||
@ -746,7 +766,7 @@ function Event(suffix) {}
|
||||
*/
|
||||
function simulateNativeEventOnNode(topLevelType, node, fakeNativeEvent) {
|
||||
fakeNativeEvent.target = node;
|
||||
dispatchEvent(topLevelType, fakeNativeEvent);
|
||||
ReactDOMEventListener.dispatchEvent(topLevelType, fakeNativeEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -771,7 +791,7 @@ function findAllInRenderedFiberTreeInternal(fiber, test) {
|
||||
var node = currentParent;
|
||||
var ret = [];
|
||||
while (true) {
|
||||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionComponent) {
|
||||
if (node.tag === HostComponent || node.tag === HostText || node.tag === ClassComponent || node.tag === FunctionalComponent) {
|
||||
var publicInst = node.stateNode;
|
||||
if (test(publicInst)) {
|
||||
ret.push(publicInst);
|
||||
@ -796,32 +816,6 @@ function findAllInRenderedFiberTreeInternal(fiber, test) {
|
||||
}
|
||||
}
|
||||
|
||||
function validateClassInstance(inst, methodName) {
|
||||
if (!inst) {
|
||||
// This is probably too relaxed but it's existing behavior.
|
||||
return;
|
||||
}
|
||||
if (get(inst)) {
|
||||
// This is a public instance indeed.
|
||||
return;
|
||||
}
|
||||
var received = void 0;
|
||||
var stringified = '' + inst;
|
||||
if (Array.isArray(inst)) {
|
||||
received = 'an array';
|
||||
} else if (inst && inst.nodeType === ELEMENT_NODE && inst.tagName) {
|
||||
received = 'a DOM node';
|
||||
} else if (stringified === '[object Object]') {
|
||||
received = 'object with keys {' + Object.keys(inst).join(', ') + '}';
|
||||
} else {
|
||||
received = stringified;
|
||||
}
|
||||
reactProdInvariant('286', methodName, received);
|
||||
}
|
||||
|
||||
// a stub element, lazily initialized, used by act() when flushing effects
|
||||
var actContainerElement = null;
|
||||
|
||||
/**
|
||||
* Utilities for making it easy to test React components.
|
||||
*
|
||||
@ -851,7 +845,7 @@ var ReactTestUtils = {
|
||||
},
|
||||
|
||||
isDOMComponent: function (inst) {
|
||||
return !!(inst && inst.nodeType === ELEMENT_NODE && inst.tagName);
|
||||
return !!(inst && inst.nodeType === 1 && inst.tagName);
|
||||
},
|
||||
|
||||
isDOMComponentElement: function (inst) {
|
||||
@ -877,10 +871,10 @@ var ReactTestUtils = {
|
||||
},
|
||||
|
||||
findAllInRenderedTree: function (inst, test) {
|
||||
validateClassInstance(inst, 'findAllInRenderedTree');
|
||||
if (!inst) {
|
||||
return [];
|
||||
}
|
||||
!ReactTestUtils.isCompositeComponent(inst) ? reactProdInvariant('10') : void 0;
|
||||
var internalInstance = get(inst);
|
||||
return findAllInRenderedFiberTreeInternal(internalInstance, test);
|
||||
},
|
||||
@ -891,7 +885,6 @@ var ReactTestUtils = {
|
||||
* @return {array} an array of all the matches.
|
||||
*/
|
||||
scryRenderedDOMComponentsWithClass: function (root, classNames) {
|
||||
validateClassInstance(root, 'scryRenderedDOMComponentsWithClass');
|
||||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
||||
if (ReactTestUtils.isDOMComponent(inst)) {
|
||||
var className = inst.className;
|
||||
@ -920,7 +913,6 @@ var ReactTestUtils = {
|
||||
* @return {!ReactDOMComponent} The one match.
|
||||
*/
|
||||
findRenderedDOMComponentWithClass: function (root, className) {
|
||||
validateClassInstance(root, 'findRenderedDOMComponentWithClass');
|
||||
var all = ReactTestUtils.scryRenderedDOMComponentsWithClass(root, className);
|
||||
if (all.length !== 1) {
|
||||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for class:' + className);
|
||||
@ -934,7 +926,6 @@ var ReactTestUtils = {
|
||||
* @return {array} an array of all the matches.
|
||||
*/
|
||||
scryRenderedDOMComponentsWithTag: function (root, tagName) {
|
||||
validateClassInstance(root, 'scryRenderedDOMComponentsWithTag');
|
||||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
||||
return ReactTestUtils.isDOMComponent(inst) && inst.tagName.toUpperCase() === tagName.toUpperCase();
|
||||
});
|
||||
@ -947,7 +938,6 @@ var ReactTestUtils = {
|
||||
* @return {!ReactDOMComponent} The one match.
|
||||
*/
|
||||
findRenderedDOMComponentWithTag: function (root, tagName) {
|
||||
validateClassInstance(root, 'findRenderedDOMComponentWithTag');
|
||||
var all = ReactTestUtils.scryRenderedDOMComponentsWithTag(root, tagName);
|
||||
if (all.length !== 1) {
|
||||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for tag:' + tagName);
|
||||
@ -960,7 +950,6 @@ var ReactTestUtils = {
|
||||
* @return {array} an array of all the matches.
|
||||
*/
|
||||
scryRenderedComponentsWithType: function (root, componentType) {
|
||||
validateClassInstance(root, 'scryRenderedComponentsWithType');
|
||||
return ReactTestUtils.findAllInRenderedTree(root, function (inst) {
|
||||
return ReactTestUtils.isCompositeComponentWithType(inst, componentType);
|
||||
});
|
||||
@ -973,7 +962,6 @@ var ReactTestUtils = {
|
||||
* @return {!ReactComponent} The one match.
|
||||
*/
|
||||
findRenderedComponentWithType: function (root, componentType) {
|
||||
validateClassInstance(root, 'findRenderedComponentWithType');
|
||||
var all = ReactTestUtils.scryRenderedComponentsWithType(root, componentType);
|
||||
if (all.length !== 1) {
|
||||
throw new Error('Did not find exactly one match (found: ' + all.length + ') ' + 'for componentType:' + componentType);
|
||||
@ -1011,26 +999,7 @@ var ReactTestUtils = {
|
||||
},
|
||||
|
||||
Simulate: null,
|
||||
SimulateNative: {},
|
||||
|
||||
act: function (callback) {
|
||||
if (actContainerElement === null) {
|
||||
// warn if we can't actually create the stub element
|
||||
actContainerElement = document.createElementNS('http://www.w3.org/1999/xhtml', 'div');
|
||||
}
|
||||
|
||||
var result = ReactDOM.unstable_batchedUpdates(callback);
|
||||
// note: keep these warning messages in sync with
|
||||
// createReactNoop.js and ReactTestRenderer.js
|
||||
ReactDOM.render(React.createElement('div', null), actContainerElement);
|
||||
// we want the user to not expect a return,
|
||||
// but we want to warn if they use it like they can await on it.
|
||||
return {
|
||||
then: function () {
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
SimulateNative: {}
|
||||
};
|
||||
|
||||
/**
|
||||
@ -1046,7 +1015,7 @@ function makeSimulator(eventType) {
|
||||
!!React.isValidElement(domNode) ? reactProdInvariant('228') : void 0;
|
||||
!!ReactTestUtils.isCompositeComponent(domNode) ? reactProdInvariant('229') : void 0;
|
||||
|
||||
var dispatchConfig = eventNameDispatchConfigs[eventType];
|
||||
var dispatchConfig = EventPluginRegistry.eventNameDispatchConfigs[eventType];
|
||||
|
||||
var fakeNativeEvent = new Event();
|
||||
fakeNativeEvent.target = domNode;
|
||||
@ -1054,7 +1023,7 @@ function makeSimulator(eventType) {
|
||||
|
||||
// We don't use SyntheticEvent.getPooled in order to not have to worry about
|
||||
// properly destroying any properties assigned from `eventData` upon release
|
||||
var targetInst = getInstanceFromNode(domNode);
|
||||
var targetInst = ReactDOMComponentTree.getInstanceFromNode(domNode);
|
||||
var event = new SyntheticEvent(dispatchConfig, targetInst, fakeNativeEvent, domNode);
|
||||
|
||||
// Since we aren't using pooling, always persist the event. This will make
|
||||
@ -1063,18 +1032,18 @@ function makeSimulator(eventType) {
|
||||
_assign(event, eventData);
|
||||
|
||||
if (dispatchConfig.phasedRegistrationNames) {
|
||||
accumulateTwoPhaseDispatches(event);
|
||||
EventPropagators.accumulateTwoPhaseDispatches(event);
|
||||
} else {
|
||||
accumulateDirectDispatches(event);
|
||||
EventPropagators.accumulateDirectDispatches(event);
|
||||
}
|
||||
|
||||
ReactDOM.unstable_batchedUpdates(function () {
|
||||
// Normally extractEvent enqueues a state restore, but we'll just always
|
||||
// do that since we're by-passing it here.
|
||||
enqueueStateRestore(domNode);
|
||||
runEventsInBatch(event);
|
||||
// do that since we we're by-passing it here.
|
||||
ReactControlledComponent.enqueueStateRestore(domNode);
|
||||
EventPluginHub.runEventsInBatch(event, true);
|
||||
});
|
||||
restoreStateIfNeeded();
|
||||
ReactControlledComponent.restoreStateIfNeeded();
|
||||
};
|
||||
}
|
||||
|
||||
@ -1082,7 +1051,7 @@ function buildSimulators() {
|
||||
ReactTestUtils.Simulate = {};
|
||||
|
||||
var eventType = void 0;
|
||||
for (eventType in eventNameDispatchConfigs) {
|
||||
for (eventType in EventPluginRegistry.eventNameDispatchConfigs) {
|
||||
/**
|
||||
* @param {!Element|ReactDOMComponent} domComponentOrNode
|
||||
* @param {?object} eventData Fake event data to use in SyntheticEvent.
|
||||
@ -1091,6 +1060,18 @@ function buildSimulators() {
|
||||
}
|
||||
}
|
||||
|
||||
// Rebuild ReactTestUtils.Simulate whenever event plugins are injected
|
||||
var oldInjectEventPluginOrder = EventPluginHub.injection.injectEventPluginOrder;
|
||||
EventPluginHub.injection.injectEventPluginOrder = function () {
|
||||
oldInjectEventPluginOrder.apply(this, arguments);
|
||||
buildSimulators();
|
||||
};
|
||||
var oldInjectEventPlugins = EventPluginHub.injection.injectEventPluginsByName;
|
||||
EventPluginHub.injection.injectEventPluginsByName = function () {
|
||||
oldInjectEventPlugins.apply(this, arguments);
|
||||
buildSimulators();
|
||||
};
|
||||
|
||||
buildSimulators();
|
||||
|
||||
/**
|
||||
@ -1143,7 +1124,7 @@ var ReactTestUtils$3 = ( ReactTestUtils$2 && ReactTestUtils ) || ReactTestUtils$
|
||||
|
||||
// TODO: decide on the top-level export form.
|
||||
// This is hacky but makes it work with both Rollup and Jest.
|
||||
var testUtils = ReactTestUtils$3.default || ReactTestUtils$3;
|
||||
var testUtils = ReactTestUtils$3.default ? ReactTestUtils$3.default : ReactTestUtils$3;
|
||||
|
||||
return testUtils;
|
||||
|
||||
|
9769
devtools/client/shared/vendor/react-dom.js
vendored
9769
devtools/client/shared/vendor/react-dom.js
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
829
devtools/client/shared/vendor/react-prop-types.js
vendored
829
devtools/client/shared/vendor/react-prop-types.js
vendored
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
7944
devtools/client/shared/vendor/react-test-renderer.js
vendored
7944
devtools/client/shared/vendor/react-test-renderer.js
vendored
File diff suppressed because it is too large
Load Diff
1450
devtools/client/shared/vendor/react.js
vendored
1450
devtools/client/shared/vendor/react.js
vendored
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user